Discussion:
Change in vdsm[master]: cmdutils: add env to exec_sync_bytes()'s args
Code Review
2017-07-21 18:46:56 UTC
Permalink
From Dan Kenigsberg <***@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 <***@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()



--
To view, visit https://gerrit.ovirt.org/79694
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I109c50c4dd85347e12e8a9a11963b0cded685536
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <***@redhat.com>
_______________________________________________
vdsm-patches mailing list -- vdsm-***@lists.fedorahosted.org
To unsubscribe send an
Code Review
2017-08-01 18:12:15 UTC
Permalink
From Dan Kenigsberg <***@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_manual/899/

--
To view, visit https://gerrit.ovirt.org/79694
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I109c50c4dd85347e12e8a9a11963b0cded685536
Gerrit-PatchSet: 10
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <***@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <***@redhat.com>
Gerrit-Reviewer: Edward Haas <***@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <***@redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <***@gmail.com>
Gerrit-Reviewer: gerrit-hooks <***@ovirt.org>
Gerrit-HasComments: No
_______________________________________________
vdsm-patches mailing list -- vdsm-***@lists.fedorahosted.org
To unsubscribe send an ema
Code Review
2017-08-03 17:36:46 UTC
Permalink
From Dan Kenigsberg <***@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)


--
To view, visit https://gerrit.ovirt.org/79694
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I109c50c4dd85347e12e8a9a11963b0cded685536
Gerrit-PatchSet: 10
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <***@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <***@redhat.com>
Gerrit-Reviewer: Edward Haas <***@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <***@redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <***@gmail.com>
Gerrit-Reviewer: gerrit-hooks <***@ovirt.org>
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list -- vdsm-***@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-***@lis
Code Review
2017-08-17 12:13:20 UTC
Permalink
From Dan Kenigsberg <***@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 <***@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



--
To view, visit https://gerrit.ovirt.org/79694
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I109c50c4dd85347e12e8a9a11963b0cded685536
Gerrit-PatchSet: 11
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <***@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <***@redhat.com>
Gerrit-Reviewer: Edward Haas <***@redhat.com>
Gerrit-Reviewer: Francesco Romani <***@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <***@redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <***@gmail.com>
Gerrit-Reviewer: gerrit-hooks <***@ovirt.org>
_______________________________________________
vdsm-patches mailing list -- vdsm-***@lists.fedorahosted.org
To unsubscribe send an email to vdsm

Loading...