Change in vdsm[master]: utils: move nice ionice sid and sudo out of execCmd

nsoffer at redhat.com nsoffer at redhat.com
Thu Dec 18 07:47:47 UTC 2014


Nir Soffer has posted comments on this change.

Change subject: utils: move nice ionice sid and sudo out of execCmd
......................................................................


Patch Set 4:

(5 comments)

http://gerrit.ovirt.org/#/c/33691/4/lib/vdsm/cmdutils.py
File lib/vdsm/cmdutils.py:

Line 44:     command.extend(cmd)
Line 45:     return command
Line 46: 
Line 47: 
Line 48: def sudo(cmd):
This can be simplified and more similar to other commands:

    if os.geteuid() == 0:
        return cmd
    command = [constants.EXT_SUDO, SUDO_NON_INTERACTIVE_FLAG]
    command.extend(cmd)
    return command
Line 49:     command = []
Line 50:     if os.geteuid() != 0:
Line 51:         command.extend((constants.EXT_SUDO, SUDO_NON_INTERACTIVE_FLAG))
Line 52:     command.extend(cmd)


http://gerrit.ovirt.org/#/c/33691/4/lib/vdsm/utils.py
File lib/vdsm/utils.py:

Line 584
Line 585
Line 586
Line 587
Line 588
We can remove this now, as cmdutils.xxx _list2cmdline and Popen can work with both tuples and lists, and there is no reason to support iterators.


Line 595
Line 596
Line 597
Line 598
Line 599
This was the reason we had to do convert command to a list.


Line 598
Line 599
Line 600
Line 601
Line 602
Same, command doe not have to be a list now


Line 602
Line 603
Line 604
Line 605
Line 606
Same, command does not have to be a list now


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I442c64e8b9cfb3933dbe9879b1d442d0e96fbe40
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dkuznets at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Yoav Kleinberger <ykleinbe 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