Nir Soffer has posted comments on this change. Change subject: Adding python3 run for nosetests ......................................................................
Patch Set 8: (5 comments) Good idea https://gerrit.ovirt.org/#/c/48051/8/lib/vdsm/config.py.in File lib/vdsm/config.py.in: Line 19: # Line 20: Line 21: from __future__ import absolute_import Line 22: import os Line 23: from six.moves import configparser as ConfigParser Don't keep the old ugly name, do: from six.moves import configparser Now we can use configparser in both 2 and 3. Line 24: import textwrap Line 25: Line 26: parameters = [ Line 27: # Section: [vars] https://gerrit.ovirt.org/#/c/48051/8/lib/vdsm/utils.py File lib/vdsm/utils.py: Line 32: from fnmatch import fnmatch Line 33: try: Line 34: from StringIO import StringIO Line 35: except ImportError: Line 36: from io import StringIO Can't we always use io.StringIO? Line 37: from weakref import proxy Line 38: from .compat import pickle Line 39: import distutils.spawn Line 40: import errno Line 633: """ Line 634: Line 635: # Moving import here so that import utils over python3 will work. Once Line 636: # python3-cpopen will be available this import should return to top Line 637: from cpopen import CPopen Better move cpopen to compat, so we can do this everywhere: from vdsm.compat import Popen In compat, do: try: from cpopen import CPopen as Popen except ImportError: from subprocess import Popen Now it work on both 2 and 3. Of course, we must remove the non-standard childUmask parameter first, and always specify stdout, stdin, and stderr - otherwise we will not have pipes for the process. Line 638: Line 639: command = cmdutils.wrap_command(command, with_ioclass=ioclass, Line 640: ioclassdata=ioclassdata, with_nice=nice, Line 641: with_setsid=setsid, with_sudo=sudo, https://gerrit.ovirt.org/#/c/48051/8/tests/testlib.py File tests/testlib.py: Line 26: import platform Line 27: import unittest Line 28: from functools import wraps Line 29: import shutil Line 30: from six.moves import configparser as ConfigParser Don't rename new nice python3 name to old ugly python2 name. Line 31: import sys Line 32: import tempfile Line 33: import threading Line 34: from contextlib import contextmanager https://gerrit.ovirt.org/#/c/48051/8/vdsm.spec.in File vdsm.spec.in: Line 93 Line 94 Line 95 Line 96 Line 97 Lets seprate python3 group with an empty line and a comment. -- To view, visit https://gerrit.ovirt.org/48051 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I83355cce2af9125e6f017017905056956cd17081 Gerrit-PatchSet: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Yaniv Bronhaim <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer <[email protected]> Gerrit-Reviewer: Yaniv Bronhaim <[email protected]> Gerrit-Reviewer: Yeela Kaplan <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
