Nir Soffer has posted comments on this change.
Change subject: utils: Faster version of list2cmdline ......................................................................
Patch Set 1:
(2 comments)
http://gerrit.ovirt.org/#/c/27548/1/lib/vdsm/utils.py File lib/vdsm/utils.py:
Line 656: parts = [] Line 657: for arg in seq: Line 658: if "'" in arg: Line 659: arg = arg.replace("'", "'") Line 660: if ' ' in arg:
doublequotes is intentionaly ignored? If so, pls mention in docstring
I assume that quoting with single quote is the simplest and safest way, so I can ignore anything "special" inside the string, except another single quote. Line 661: arg = "'" + arg + "'" Line 662: parts.append(arg) Line 663: return ' '.join(parts) Line 664:
Line 699: if not printable: Line 700: printable = command Line 701: Line 702: cmdline = repr(list2cmdline(printable)) Line 703: execCmdLogger.debug("%s (cwd %s)", cmdline, cwd)
Using %r here (and elsewhere) would save a couple of cycles if non-debug lo
How %r would be less expensive then %s? Line 704: Line 705: p = CPopen(command, close_fds=True, cwd=cwd, env=env, Line 706: deathSignal=deathSignal, childUmask=childUmask) Line 707: p = AsyncProc(p)