Change in vdsm[master]: utils: split out execCmd wrapping logic
nsoffer at redhat.com
nsoffer at redhat.com
Wed Oct 7 20:55:53 UTC 2015
Nir Soffer has posted comments on this change.
Change subject: utils: split out execCmd wrapping logic
......................................................................
Patch Set 1: Code-Review-1
(3 comments)
I like this very much, but there some issues.
https://gerrit.ovirt.org/#/c/47107/1/lib/vdsm/utils.py
File lib/vdsm/utils.py:
Line 666
Line 667
Line 668
Line 669
Line 670
This belongs to execCmd - it does not wrap the command.
We should also kill this, there is no reason to support generators/iterators as input to execCmd or to wrap_command.
Line 628: _ANY_CPU = ["0-%d" % (os.sysconf('SC_NPROCESSORS_ONLN') - 1)]
Line 629: _USING_CPU_AFFINITY = config.get('vars', 'cpu_affinity') != ""
Line 630:
Line 631:
Line 632: def wrap_command(command, ioclass=None, ioclassdata=None, nice=None,
How about moving this to cmdutils.wrap_command?
Line 633: setsid=False, sudo=False, reset_cpu_affinity=True):
Line 634: if ioclass is not None:
Line 635: command = cmdutils.ionice(command, ioclass=ioclass,
Line 636: ioclassdata=ioclassdata)
Line 674: finish, the new subprocess would die immediately.
Line 675: """
Line 676:
Line 677: command = wrap_command(command, ioclass, ioclassdata, nice, setsid, sudo,
Line 678: resetCpuAffinity)
Must use kwarg style key=value for all kwargs.
Line 679: if not printable:
Line 680: printable = command
Line 681:
Line 682: execCmdLogger.debug(cmdutils.command_log_line(printable, cwd=cwd))
--
To view, visit https://gerrit.ovirt.org/47107
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I98a01c4e8c80202b8e897dacc7628504d3cf7771
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list