Change in vdsm[master]: Added Python 3 support for sslTests.py
danken at redhat.com
danken at redhat.com
Sun Dec 27 08:49:30 UTC 2015
Dan Kenigsberg has posted comments on this change.
Change subject: Added Python 3 support for sslTests.py
......................................................................
Patch Set 2:
(4 comments)
https://gerrit.ovirt.org/#/c/50760/2/lib/vdsm/utils.py
File lib/vdsm/utils.py:
Line 52: import threading
Line 53: import time
Line 54: import vdsm.infra.zombiereaper as zombiereaper
Line 55:
Line 56: if sys.version[0] == '2':
Yaniv has asked you to rebase on top of his own patch https://gerrit.ovirt.org/#/c/50902/1 , not to incorporate it into yours.
Line 57: from StringIO import StringIO
Line 58: from cpopen import CPopen
Line 59: else:
Line 60: from warnings import warn
https://gerrit.ovirt.org/#/c/50760/2/tests/integration/sslhelper.py
File tests/integration/sslhelper.py:
Line 11: import six
redundant import
https://gerrit.ovirt.org/#/c/50760/2/tests/sslTests.py
File tests/sslTests.py:
Line 25: import six
here too, the "import six" is redundant. Please place the "from six.moves" import here.
Line 191: """
Line 192:
Line 193: # Save the key to a file:
Line 194: with tempfile.NamedTemporaryFile(delete=False) as tmp:
Line 195: tmp.write(six.b(KEY))
from https://pythonhosted.org/six/#binary-and-text-data
"""
six.b(data)
A “fake” bytes literal. data should always be a normal string literal. In Python 2, b() returns a 8-bit string. In Python 3, data is encoded with the latin-1 encoding to bytes.
Note
Since all Python versions 2.6 and after support the b prefix, b(), code without 2.5 support doesn’t need b().
"""
Line 196: self.keyfile = tmp.name
Line 197:
Line 198: # Save the certificate to a file:
Line 199: with tempfile.NamedTemporaryFile(delete=False) as tmp:
--
To view, visit https://gerrit.ovirt.org/50760
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ifd7ee76d814d1661f5bd98ea37b6707d2f6f7fd1
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Benjamin Kemper <kemperbenny at gmail.com>
Gerrit-Reviewer: Benjamin Kemper <kemperbenny at gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken 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