Change in vdsm[master]: utils: Faster version of list2cmdline

danken at redhat.com danken at redhat.com
Wed May 14 21:14:00 UTC 2014


Dan Kenigsberg has posted comments on this change.

Change subject: utils: Faster version of list2cmdline
......................................................................


Patch Set 4: Code-Review-1

(2 comments)

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

Line 644:         self._poller.close()
Line 645: 
Line 646: 
Line 647: # ASCII alphanumeric characters and some other safe characters do not need
Line 648: # quoting. Anything else will be quoted in _list2cmdline.
pipes.quote has

 _safechars = frozenset(string.ascii_letters + string.digits + '@%_-+=:,./')

I trust that re is faster, but please match the set of chars.
Line 649: _unsafe = re.compile(r'[^a-zA-Z0-9_\-=/:,]').search
Line 650: 
Line 651: 
Line 652: def _list2cmdline(args):


Line 645: 
Line 646: 
Line 647: # ASCII alphanumeric characters and some other safe characters do not need
Line 648: # quoting. Anything else will be quoted in _list2cmdline.
Line 649: _unsafe = re.compile(r'[^a-zA-Z0-9_\-=/:,]').search
utils is growing big; please use a more specific function name (_requires_quote ?) so as not to confuse future reviewers.
Line 650: 
Line 651: 
Line 652: def _list2cmdline(args):
Line 653:     """


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibfc7819c126fe51cc068cc6f9f85b1002878385b
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alonbl at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer 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