Change in vdsm[master]: commands: import StringIO only on Python 2

nsoffer at redhat.com nsoffer at redhat.com
Wed Mar 30 12:33:51 UTC 2016


Nir Soffer has posted comments on this change.

Change subject: commands: import StringIO only on Python 2
......................................................................


Patch Set 3: -Code-Review

(2 comments)

https://gerrit.ovirt.org/#/c/55380/3/lib/vdsm/commands.py
File lib/vdsm/commands.py:

Line 71
Line 72
Line 73
Line 74
Line 75
We can import in AsyncProc.__init__


Line 37: 
Line 38: # this is an ugly hack to let this module load on Python 3, and fail later when
Line 39: # AsyncProc is used.
Line 40: if sys.version_info[0] == 2:
Line 41:     from StringIO import StringIO
> But this module cannot run on Python 3 - how does this help testing the cod
How about moving the import into AsyncProc - this is the only code here that needs StringIO, so execCmd(sync=True) will works with Pthon3 (now that CPopen is abstracted away).
Line 42: 
Line 43: # Buffsize is 1K because I tested it on some use cases and 1K was fastest. If
Line 44: # you find this number to be a bottleneck in any way you are welcome to change
Line 45: # it


-- 
To view, visit https://gerrit.ovirt.org/55380
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3610865945aeee3b13b8e195c749023a524ebe97
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken 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: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list