From Yaniv Bronhaim <ybronhei(a)redhat.com>:
Yaniv Bronhaim has posted comments on this change.
Change subject: [RFC] procutils: Introduce the procutils module
......................................................................
Patch Set 8:
(2 comments)
https://gerrit.ovirt.org/#/c/74927/8//COMMIT_MSG
Commit Message:
Line 3: AuthorDate: 2017-03-28 03:38:45 +0300
Line 4: Commit: Nir Soffer <nsoffer(a)redhat.com>
Line 5: CommitDate: 2017-04-02 05:19:08 +0300
Line 6:
Line 7: [RFC] procutils: Introduce the procutils module
I don't see a reason not to put this code under commands.py
Line 8:
Line 9: This module provide utilities for working with subprocesses.
Line 10:
Line 11: The first utility is procutils.communicate(), replacing both AsyncProc,
https://gerrit.ovirt.org/#/c/74927/8/lib/vdsm/common/procutils.py
File lib/vdsm/common/procutils.py:
Line 45:
Line 46: def communicate(p, timeout=None, bufsize=io.DEFAULT_BUFFER_SIZE):
Line 47: """
Line 48: Communicate with process, yielding data read from stdout and stderr until
Line 49: proccess terminates or timeout expires.
1. please compare the differences between this implementation to
subprocess.Popen.communicate [below]- the builtin one waits until ... and this one is
until .. and we needed that for 1 2 3 ..
2. for infra its more appropriate to keep the same func signature
def communicate(self, input=None, timeout=None):
"""Interact with process: Send data to stdin. Read data from
stdout and stderr, until end-of-file is reached. Wait for
process to terminate.
The optional "input" argument should be data to be sent to the
child process (if self.universal_newlines is True, this should
be a string; if it is False, "input" should be bytes), or
None, if no data should be sent to the child.
communicate() returns a tuple (stdout, stderr). These will be
bytes or, if self.universal_newlines was True, a string.
"""
Line 50:
Line 51: Unlike Popen.communicate, this support a timeout, and allows reading both
Line 52: stdout and stderr with a single thread.
Line 53:
--
To view, visit
https://gerrit.ovirt.org/74927
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I7d193caa5da0ed564b4fab12aa85e3751f1a1df7
Gerrit-PatchSet: 8
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Denis Chaplygin <dchaplyg(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: Yes