Adding Python3 support

- Only support python3.6
- Add tox py36 env to pass unittest in python3.6.
- Fix python3 compatible issues that found by py36 unittests.

Change-Id: I66fee060005cfdfd08b78134eae000dd198ee025
changes/99/641599/2
Shu Juan Zhang 4 years ago
parent 10d9a05934
commit 3d0b37db26
  1. 2
      neutron/plugins/zvm/agent/zvm_neutron_agent.py
  2. 2
      setup.cfg
  3. 12
      tox.ini

@ -39,7 +39,7 @@ CONF = cfg.CONF
def restart_wrapper(func):
def wrapper(*args, **kw):
gen = func(*args, **kw)
gen.next()
next(gen)
return gen
return wrapper

@ -13,6 +13,8 @@ classifier =
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
[entry_points]
neutron.ml2.mechanism_drivers =

@ -1,6 +1,6 @@
[tox]
minversion = 1.6
envlist = pep8,py27
envlist = pep8,py27,py36
skipsdist = True
[testenv]
@ -26,6 +26,16 @@ commands = pip install "-egit+https://github.com/openstack/neutron@master#egg=ne
{toxinidir}/.tox/py27/src/neutron/neutron/plugins/ml2/drivers/
python setup.py testr --slowest --testr-args='{posargs}'
[testenv:py36]
whitelist_externals = *
commands = pip install "-egit+https://github.com/openstack/neutron@master#egg=neutron"
cp -r {toxinidir}/neutron/plugins/zvm \
{toxinidir}/.tox/py36/src/neutron/neutron/plugins/
cp -r {toxinidir}/neutron/plugins/ml2/drivers/zvm \
{toxinidir}/.tox/py36/src/neutron/neutron/plugins/ml2/drivers/
python setup.py testr --slowest --testr-args='{posargs}'
[testenv:venv]
commands = {posargs}

Loading…
Cancel
Save