Change in vdsm[master]: util: fix execCmd to accept tuples

danken at redhat.com danken at redhat.com
Wed Mar 26 12:15:56 UTC 2014


Dan Kenigsberg has posted comments on this change.

Change subject: util: fix execCmd to accept tuples
......................................................................


Patch Set 2: Code-Review-1

(3 comments)

http://gerrit.ovirt.org/#/c/26070/2//COMMIT_MSG
Commit Message:

Line 5: CommitDate: 2014-03-26 11:23:18 +0200
Line 6: 
Line 7: util: fix execCmd to accept tuples
Line 8: 
Line 9: There was an issue when occasionally when flags were given along with a
english: double "when".
Line 10: command in a tuple, there was an exception in execCmd, because +
Line 11: operator was used to append tuple with commands to a list.
Line 12: 
Line 13: Added parameter to execCmd to make the testing a bit easier, it


Line 9: There was an issue when occasionally when flags were given along with a
Line 10: command in a tuple, there was an exception in execCmd, because +
Line 11: operator was used to append tuple with commands to a list.
Line 12: 
Line 13: Added parameter to execCmd to make the testing a bit easier, it
Please do not add this awkward test-only API. I think that monkey-patching CPopen can provide the very same functionality, isnt it?
Line 14: instructs execCmd to attach the command it runs to AsyncProc it returns.
Line 15: 
Line 16: Change-Id: I8d1269d9a26b1fef1552976ae626cf4596471283


http://gerrit.ovirt.org/#/c/26070/2/lib/vdsm/utils.py
File lib/vdsm/utils.py:

Line 674:             command = itertools.chain([constants.EXT_SUDO,
Line 675:                                        SUDO_NON_INTERACTIVE_FLAG],
Line 676:                                       command)
Line 677: 
Line 678:     command = list(command)
why is this a list() and not tuple()? Does  CPopen require that? (it should not)
Line 679:     if not printable:
Line 680:         printable = command
Line 681: 
Line 682:     cmdline = repr(subprocess.list2cmdline(printable))


-- 
To view, visit http://gerrit.ovirt.org/26070
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I8d1269d9a26b1fef1552976ae626cf4596471283
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dima Kuznetsov <dkuznets at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list