Browse Source

fix tox python3 overrides

We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: I4e21f379bf145eb4d40fcd870f09886d7587accb
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Co-Authored-By: Lucas Alvares Gomes <lucasagomes@gmail.com>
tags/6.0.0.0b1
Doug Hellmann 1 year ago
committed by Lucas Alvares Gomes
parent
commit
bbba70c3b6
9 changed files with 24 additions and 14 deletions
  1. +7
    -1
      .pylintrc
  2. +2
    -1
      lower-constraints.txt
  3. +2
    -2
      networking_ovn/agent/metadata/server.py
  4. +2
    -2
      networking_ovn/common/acl.py
  5. +2
    -2
      networking_ovn/common/ovn_client.py
  6. +1
    -1
      networking_ovn/l3/l3_ovn.py
  7. +1
    -1
      networking_ovn/ovsdb/impl_idl_ovn.py
  8. +2
    -1
      test-requirements.txt
  9. +5
    -3
      tox.ini

+ 7
- 1
.pylintrc View File

@@ -53,7 +53,13 @@ disable=
too-many-locals,
too-many-public-methods,
too-many-return-statements,
too-many-statements
too-many-statements,
inconsistent-return-statements,
useless-object-inheritance,
too-many-nested-blocks,
too-many-boolean-expressions,
not-callable


[BASIC]
# Variable names can be 1 to 31 characters long, with lowercase and underscores


+ 2
- 1
lower-constraints.txt View File

@@ -102,7 +102,8 @@ pycparser==2.18
pyflakes==0.8.1
Pygments==2.2.0
pyinotify==0.9.6
pylint==1.4.5
pylint==1.9.3;python_version=='2.7'
pylint==2.1.1;python_version>='3.0'
pyOpenSSL==17.1.0
pyparsing==2.1.0
pyperclip==1.5.27


+ 2
- 2
networking_ovn/agent/metadata/server.py View File

@@ -25,7 +25,7 @@ from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import encodeutils
import six
import six.moves.urllib.parse as urlparse
from six.moves import urllib
import webob

from networking_ovn._i18n import _
@@ -100,7 +100,7 @@ class MetadataProxyHandler(object):
self.conf.nova_metadata_port)
LOG.debug('Request to Nova at %s', nova_host_port)
LOG.debug(headers)
url = urlparse.urlunsplit((
url = urllib.parse.urlunsplit((
self.conf.nova_metadata_protocol,
nova_host_port,
req.path_info,


+ 2
- 2
networking_ovn/common/acl.py View File

@@ -96,7 +96,7 @@ def _get_protocol_number(protocol):
return
try:
protocol = int(protocol)
if protocol >= 0 and protocol <= 255:
if 0 <= protocol <= 255:
return str(protocol)
except (ValueError, TypeError):
protocol = PROTOCOL_NAME_TO_NUM_MAP.get(protocol)
@@ -455,7 +455,7 @@ def update_acls_for_security_group(plugin,

if not update_port_list:
return
lswitch_names = set([p['network_id'] for p in update_port_list])
lswitch_names = {p['network_id'] for p in update_port_list}

ovn.update_acls(list(lswitch_names),
iter(update_port_list),


+ 2
- 2
networking_ovn/common/ovn_client.py View File

@@ -84,9 +84,9 @@ class OVNClient(object):
def _transaction(self, commands, txn=None):
"""Create a new transaction or add the commands to an existing one."""
if txn is None:
with self._nb_idl.transaction(check_error=True) as txn:
with self._nb_idl.transaction(check_error=True) as new_txn:
for cmd in commands:
txn.add(cmd)
new_txn.add(cmd)
else:
for cmd in commands:
txn.add(cmd)


+ 1
- 1
networking_ovn/l3/l3_ovn.py View File

@@ -349,7 +349,7 @@ class OVNL3RouterPlugin(service_base.ServicePluginBase,
'device_owner': [n_const.DEVICE_OWNER_ROUTER_GW],
'fixed_ips': {'subnet_id': [orig['id']]},
})
router_ids = set([port['device_id'] for port in gw_ports])
router_ids = {port['device_id'] for port in gw_ports}
remove = [{'destination': '0.0.0.0/0', 'nexthop': orig_gw_ip}
] if orig_gw_ip else []
add = [{'destination': '0.0.0.0/0', 'nexthop': current_gw_ip}


+ 1
- 1
networking_ovn/ovsdb/impl_idl_ovn.py View File

@@ -797,7 +797,7 @@ class OvsdbSbOvnIdl(sb_impl_idl.OvnSbApiIdlImpl, Backend):
def set_port_cidrs(self, name, cidrs):
# TODO(twilson) add if_exists to db commands
return self.db_set('Port_Binding', name, 'external_ids',
{'neutron-port-cidrs': cidrs}, if_exists=True)
{'neutron-port-cidrs': cidrs})

def get_ports_on_chassis(self, chassis):
# TODO(twilson) Some day it would be nice to stop passing names around


+ 2
- 1
test-requirements.txt View File

@@ -12,7 +12,8 @@ openstackdocstheme>=1.18.1 # Apache-2.0
doc8>=0.6.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0
os-testr>=1.0.0 # Apache-2.0
pylint==1.4.5 # GPLv2
pylint==1.9.3;python_version=='2.7' # GPLv2
pylint==2.1.1;python_version>='3.0' # GPLv2
testresources>=2.0.0 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD
WebTest>=2.0.27 # MIT


+ 5
- 3
tox.ini View File

@@ -19,13 +19,14 @@ commands =
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY

[testenv:pep8]
basepython = python2.7
basepython = python3
commands = flake8
{toxinidir}/tools/coding-checks.sh --pylint '{posargs}'
doc8 doc/source devstack releasenotes/source vagrant rally-jobs
neutron-db-manage --subproject=networking-ovn check_migration

[testenv:venv]
basepython = python3
commands = {posargs}

[testenv:functional]
@@ -66,7 +67,7 @@ commands =
{toxinidir}/tools/ostestr_compat_shim.sh {posargs}

[testenv:cover]
basepython = python2.7
basepython = python3
setenv =
{[testenv]setenv}
PYTHON=coverage run --source networking_ovn --parallel-mode
@@ -78,7 +79,7 @@ commands =
coverage xml -o cover/coverage.xml

[testenv:docs]
basepython = python2.7
basepython = python3
commands =
rm -rf doc/build
doc8 doc/source devstack releasenotes/source vagrant rally-jobs
@@ -95,6 +96,7 @@ commands =
whitelist_externals = mkdir

[testenv:releasenotes]
basepython = python3
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html

[doc8]


Loading…
Cancel
Save