Yaniv Bronhaim has uploaded a new change for review.
Change subject: Adding toolTests.py to python3 check modules ......................................................................
Adding toolTests.py to python3 check modules
Change-Id: I52f11a1a10cae46773d05d0c09da80ad8eb3b772 Signed-off-by: Yaniv Bronhaim ybronhei@redhat.com --- M lib/vdsm/tool/configfile.py M tests/Makefile.am 2 files changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/52/48052/1
diff --git a/lib/vdsm/tool/configfile.py b/lib/vdsm/tool/configfile.py index 26ec114..0c58205 100644 --- a/lib/vdsm/tool/configfile.py +++ b/lib/vdsm/tool/configfile.py @@ -18,12 +18,12 @@ #
from __future__ import absolute_import -import ConfigParser import functools import os import tempfile import re import selinux +from six.moves import configparser as ConfigParser import io
from .. import utils @@ -263,5 +263,5 @@ def read(self, path): with open(path, 'r') as f: return self.wrapped.readfp( - io.StringIO(u'[root]\n' + f.read().decode()) + io.StringIO(u'[root]\n' + f.read()) ) diff --git a/tests/Makefile.am b/tests/Makefile.am index 205289e..3b1f8bf 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -30,6 +30,7 @@ apiData.py \ cmdutilsTests.py \ concurrentTests.py \ + toolTests.py \ $(NULL)
device_modules = \
automation@ovirt.org has posted comments on this change.
Change subject: Adding toolTests.py to python3 check modules ......................................................................
Patch Set 1:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: Adding toolTests.py to python3 check modules ......................................................................
Patch Set 2:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: Adding toolTests.py to python3 check modules ......................................................................
Patch Set 3:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: Adding toolTests.py to python3 check modules ......................................................................
Patch Set 4:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: Adding toolTests.py to python3 check modules ......................................................................
Patch Set 5:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: Adding toolTests.py to python3 check modules ......................................................................
Patch Set 6:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: Adding toolTests.py to python3 check modules ......................................................................
Patch Set 7:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Nir Soffer has posted comments on this change.
Change subject: Adding toolTests.py to python3 check modules ......................................................................
Patch Set 7: Code-Review-1
(2 comments)
https://gerrit.ovirt.org/#/c/48052/7/lib/vdsm/tool/configfile.py File lib/vdsm/tool/configfile.py:
Line 22: import os Line 23: import tempfile Line 24: import re Line 25: import selinux Line 26: from six.moves import configparser as ConfigParser Keep python3 name, rename usage of old name. Line 27: import io Line 28: Line 29: from .. import utils Line 30:
Line 262: Line 263: def read(self, path): Line 264: with open(path, 'r') as f: Line 265: return self.wrapped.readfp( Line 266: io.StringIO(u'[root]\n' + f.read()) Are you sure it works for both 2 and 3?
automation@ovirt.org has posted comments on this change.
Change subject: Adding toolTests.py to python3 check modules ......................................................................
Patch Set 8:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Yaniv Bronhaim has posted comments on this change.
Change subject: Adding toolTests.py to python3 check modules ......................................................................
Patch Set 7:
(1 comment)
https://gerrit.ovirt.org/#/c/48052/7/lib/vdsm/tool/configfile.py File lib/vdsm/tool/configfile.py:
Line 262: Line 263: def read(self, path): Line 264: with open(path, 'r') as f: Line 265: return self.wrapped.readfp( Line 266: io.StringIO(u'[root]\n' + f.read())
Are you sure it works for both 2 and 3?
the decode is indeed not required here both in python 3 and 2
gerrit-hooks has posted comments on this change.
Change subject: Fix configfile for py3 to use unicode ......................................................................
Patch Set 16:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Yaniv Bronhaim has posted comments on this change.
Change subject: Fix configfile for py3 to use unicode ......................................................................
Patch Set 16: Verified+1
Piotr Kliczewski has posted comments on this change.
Change subject: Fix configfile for py3 to use unicode ......................................................................
Patch Set 16: Code-Review+2
Dan Kenigsberg has submitted this change and it was merged.
Change subject: Fix configfile for py3 to use unicode ......................................................................
Fix configfile for py3 to use unicode
Change-Id: I52f11a1a10cae46773d05d0c09da80ad8eb3b772 Signed-off-by: Yaniv Bronhaim ybronhei@redhat.com Reviewed-on: https://gerrit.ovirt.org/48052 Continuous-Integration: Jenkins CI Reviewed-by: Piotr Kliczewski piotr.kliczewski@gmail.com --- M lib/vdsm/tool/configfile.py M tests/Makefile.am M tests/toolTests.py 3 files changed, 24 insertions(+), 10 deletions(-)
Approvals: Piotr Kliczewski: Looks good to me, approved Yaniv Bronhaim: Verified Jenkins CI: Passed CI tests
gerrit-hooks has posted comments on this change.
Change subject: Fix configfile for py3 to use unicode ......................................................................
Patch Set 17:
* Update tracker: IGNORE, no Bug-Url found * Set MODIFIED::IGNORE, no Bug-Url found.
vdsm-patches@lists.fedorahosted.org