From Dan Kenigsberg danken@redhat.com:
Dan Kenigsberg has uploaded a new change for review.
Change subject: cmdutils: add env to exec_sync_bytes()'s args ......................................................................
cmdutils: add env to exec_sync_bytes()'s args
Expose Popen's env argument throught exec_sync_bytes()
Change-Id: I109c50c4dd85347e12e8a9a11963b0cded685536 Signed-off-by: Dan Kenigsberg danken@redhat.com --- M lib/vdsm/common/cmdutils.py 1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/94/79694/1
diff --git a/lib/vdsm/common/cmdutils.py b/lib/vdsm/common/cmdutils.py index 26e08a7..c4b1d31 100644 --- a/lib/vdsm/common/cmdutils.py +++ b/lib/vdsm/common/cmdutils.py @@ -110,11 +110,12 @@ BlockIO = 'BlockIO'
-def exec_sync_bytes(cmds): +def exec_sync_bytes(cmds, env=None): logging.debug(cmdutils.command_log_line(cmds))
p = Popen( - cmds, close_fds=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + cmds, close_fds=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + env=env)
out, err = p.communicate()
From Dan Kenigsberg danken@redhat.com:
Dan Kenigsberg has posted comments on this change.
Change subject: cmdutils: add env to exec_cmd()'s args ......................................................................
Patch Set 6: Verified+1
From Dan Kenigsberg danken@redhat.com:
Dan Kenigsberg has posted comments on this change.
Change subject: cmdutils: add env to exec_cmd()'s args ......................................................................
Patch Set 8: Verified+1
From Dan Kenigsberg danken@redhat.com:
Dan Kenigsberg has posted comments on this change.
Change subject: cmdutils: add env to exec_cmd()'s args ......................................................................
Patch Set 10: Verified+1
OST passes http://jenkins.ovirt.org/view/oVirt%20system%20tests/job/ovirt-system-tests_...
From Dan Kenigsberg danken@redhat.com:
Dan Kenigsberg has posted comments on this change.
Change subject: cmdutils: add env to exec_cmd()'s args ......................................................................
Patch Set 10:
(1 comment)
https://gerrit.ovirt.org/#/c/79694/10/tests/common/cmdutils_test.py File tests/common/cmdutils_test.py:
Line 147: self.assertEqual(out, b'') Line 148: Line 149: def test_exec_cmd_with_env(self): Line 150: rc, out, err = cmdutils.exec_cmd( Line 151: ('sh', '-c', 'echo $XXX'), env={'XXX': 'hello'})
printenv XXX would be little nicer.
but more obscure - I did not know of it. Line 152: self.assertEqual(rc, 0)
From Dan Kenigsberg danken@redhat.com:
Dan Kenigsberg has submitted this change and it was merged. ( https://gerrit.ovirt.org/79694 )
Change subject: cmdutils: add env to exec_cmd()'s args ......................................................................
cmdutils: add env to exec_cmd()'s args
Expose Popen's env argument throught exec_cmd(). The newly-introduced argument is going to be used by hooks.py in the following patch.
Change-Id: I109c50c4dd85347e12e8a9a11963b0cded685536 Signed-off-by: Dan Kenigsberg danken@redhat.com --- M lib/vdsm/common/cmdutils.py M tests/common/cmdutils_test.py 2 files changed, 12 insertions(+), 2 deletions(-)
Approvals: Piotr Kliczewski: Looks good to me, approved Nir Soffer: Looks good to me, but someone else must approve Jenkins CI: Passed CI tests Dan Kenigsberg: Verified Francesco Romani: Looks good to me, but someone else must approve Edward Haas: Looks good to me, but someone else must approve
vdsm-patches@lists.fedorahosted.org