summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-11-14 13:46:35 +0000
committerGerrit Code Review <review@openstack.org>2018-11-14 13:46:35 +0000
commitdd5055f4443947804a8b480fd0fbc75f52f47282 (patch)
tree5a6187ec0d03806a28e07e409f801ba34c8c5322
parentcc05180e323b38d43cf5a806d03d8822fc5fc5df (diff)
parentbbba70c3b66ed399afb2a2dffcb83983fe5aad9f (diff)
Merge "fix tox python3 overrides"
-rw-r--r--.pylintrc8
-rw-r--r--lower-constraints.txt3
-rw-r--r--networking_ovn/agent/metadata/server.py4
-rw-r--r--networking_ovn/common/acl.py4
-rw-r--r--networking_ovn/common/ovn_client.py4
-rw-r--r--networking_ovn/l3/l3_ovn.py2
-rw-r--r--networking_ovn/ovsdb/impl_idl_ovn.py2
-rw-r--r--test-requirements.txt3
-rw-r--r--tox.ini8
9 files changed, 24 insertions, 14 deletions
diff --git a/.pylintrc b/.pylintrc
index 1019a29..525e982 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -53,7 +53,13 @@ disable=
53 too-many-locals, 53 too-many-locals,
54 too-many-public-methods, 54 too-many-public-methods,
55 too-many-return-statements, 55 too-many-return-statements,
56 too-many-statements 56 too-many-statements,
57 inconsistent-return-statements,
58 useless-object-inheritance,
59 too-many-nested-blocks,
60 too-many-boolean-expressions,
61 not-callable
62
57 63
58[BASIC] 64[BASIC]
59# Variable names can be 1 to 31 characters long, with lowercase and underscores 65# Variable names can be 1 to 31 characters long, with lowercase and underscores
diff --git a/lower-constraints.txt b/lower-constraints.txt
index caccff0..c652aa2 100644
--- a/lower-constraints.txt
+++ b/lower-constraints.txt
@@ -102,7 +102,8 @@ pycparser==2.18
102pyflakes==0.8.1 102pyflakes==0.8.1
103Pygments==2.2.0 103Pygments==2.2.0
104pyinotify==0.9.6 104pyinotify==0.9.6
105pylint==1.4.5 105pylint==1.9.3;python_version=='2.7'
106pylint==2.1.1;python_version>='3.0'
106pyOpenSSL==17.1.0 107pyOpenSSL==17.1.0
107pyparsing==2.1.0 108pyparsing==2.1.0
108pyperclip==1.5.27 109pyperclip==1.5.27
diff --git a/networking_ovn/agent/metadata/server.py b/networking_ovn/agent/metadata/server.py
index e451e5f..cb51d5d 100644
--- a/networking_ovn/agent/metadata/server.py
+++ b/networking_ovn/agent/metadata/server.py
@@ -25,7 +25,7 @@ from oslo_config import cfg
25from oslo_log import log as logging 25from oslo_log import log as logging
26from oslo_utils import encodeutils 26from oslo_utils import encodeutils
27import six 27import six
28import six.moves.urllib.parse as urlparse 28from six.moves import urllib
29import webob 29import webob
30 30
31from networking_ovn._i18n import _ 31from networking_ovn._i18n import _
@@ -100,7 +100,7 @@ class MetadataProxyHandler(object):
100 self.conf.nova_metadata_port) 100 self.conf.nova_metadata_port)
101 LOG.debug('Request to Nova at %s', nova_host_port) 101 LOG.debug('Request to Nova at %s', nova_host_port)
102 LOG.debug(headers) 102 LOG.debug(headers)
103 url = urlparse.urlunsplit(( 103 url = urllib.parse.urlunsplit((
104 self.conf.nova_metadata_protocol, 104 self.conf.nova_metadata_protocol,
105 nova_host_port, 105 nova_host_port,
106 req.path_info, 106 req.path_info,
diff --git a/networking_ovn/common/acl.py b/networking_ovn/common/acl.py
index d196f7e..f9da64b 100644
--- a/networking_ovn/common/acl.py
+++ b/networking_ovn/common/acl.py
@@ -96,7 +96,7 @@ def _get_protocol_number(protocol):
96 return 96 return
97 try: 97 try:
98 protocol = int(protocol) 98 protocol = int(protocol)
99 if protocol >= 0 and protocol <= 255: 99 if 0 <= protocol <= 255:
100 return str(protocol) 100 return str(protocol)
101 except (ValueError, TypeError): 101 except (ValueError, TypeError):
102 protocol = PROTOCOL_NAME_TO_NUM_MAP.get(protocol) 102 protocol = PROTOCOL_NAME_TO_NUM_MAP.get(protocol)
@@ -455,7 +455,7 @@ def update_acls_for_security_group(plugin,
455 455
456 if not update_port_list: 456 if not update_port_list:
457 return 457 return
458 lswitch_names = set([p['network_id'] for p in update_port_list]) 458 lswitch_names = {p['network_id'] for p in update_port_list}
459 459
460 ovn.update_acls(list(lswitch_names), 460 ovn.update_acls(list(lswitch_names),
461 iter(update_port_list), 461 iter(update_port_list),
diff --git a/networking_ovn/common/ovn_client.py b/networking_ovn/common/ovn_client.py
index 7a85f10..3f1f0b6 100644
--- a/networking_ovn/common/ovn_client.py
+++ b/networking_ovn/common/ovn_client.py
@@ -84,9 +84,9 @@ class OVNClient(object):
84 def _transaction(self, commands, txn=None): 84 def _transaction(self, commands, txn=None):
85 """Create a new transaction or add the commands to an existing one.""" 85 """Create a new transaction or add the commands to an existing one."""
86 if txn is None: 86 if txn is None:
87 with self._nb_idl.transaction(check_error=True) as txn: 87 with self._nb_idl.transaction(check_error=True) as new_txn:
88 for cmd in commands: 88 for cmd in commands:
89 txn.add(cmd) 89 new_txn.add(cmd)
90 else: 90 else:
91 for cmd in commands: 91 for cmd in commands:
92 txn.add(cmd) 92 txn.add(cmd)
diff --git a/networking_ovn/l3/l3_ovn.py b/networking_ovn/l3/l3_ovn.py
index 58a181a..8b45a11 100644
--- a/networking_ovn/l3/l3_ovn.py
+++ b/networking_ovn/l3/l3_ovn.py
@@ -349,7 +349,7 @@ class OVNL3RouterPlugin(service_base.ServicePluginBase,
349 'device_owner': [n_const.DEVICE_OWNER_ROUTER_GW], 349 'device_owner': [n_const.DEVICE_OWNER_ROUTER_GW],
350 'fixed_ips': {'subnet_id': [orig['id']]}, 350 'fixed_ips': {'subnet_id': [orig['id']]},
351 }) 351 })
352 router_ids = set([port['device_id'] for port in gw_ports]) 352 router_ids = {port['device_id'] for port in gw_ports}
353 remove = [{'destination': '0.0.0.0/0', 'nexthop': orig_gw_ip} 353 remove = [{'destination': '0.0.0.0/0', 'nexthop': orig_gw_ip}
354 ] if orig_gw_ip else [] 354 ] if orig_gw_ip else []
355 add = [{'destination': '0.0.0.0/0', 'nexthop': current_gw_ip} 355 add = [{'destination': '0.0.0.0/0', 'nexthop': current_gw_ip}
diff --git a/networking_ovn/ovsdb/impl_idl_ovn.py b/networking_ovn/ovsdb/impl_idl_ovn.py
index 70d7068..168057d 100644
--- a/networking_ovn/ovsdb/impl_idl_ovn.py
+++ b/networking_ovn/ovsdb/impl_idl_ovn.py
@@ -791,7 +791,7 @@ class OvsdbSbOvnIdl(sb_impl_idl.OvnSbApiIdlImpl, Backend):
791 def set_port_cidrs(self, name, cidrs): 791 def set_port_cidrs(self, name, cidrs):
792 # TODO(twilson) add if_exists to db commands 792 # TODO(twilson) add if_exists to db commands
793 return self.db_set('Port_Binding', name, 'external_ids', 793 return self.db_set('Port_Binding', name, 'external_ids',
794 {'neutron-port-cidrs': cidrs}, if_exists=True) 794 {'neutron-port-cidrs': cidrs})
795 795
796 def get_ports_on_chassis(self, chassis): 796 def get_ports_on_chassis(self, chassis):
797 # TODO(twilson) Some day it would be nice to stop passing names around 797 # TODO(twilson) Some day it would be nice to stop passing names around
diff --git a/test-requirements.txt b/test-requirements.txt
index 9d41d7c..4add263 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -12,7 +12,8 @@ openstackdocstheme>=1.18.1 # Apache-2.0
12doc8>=0.6.0 # Apache-2.0 12doc8>=0.6.0 # Apache-2.0
13oslotest>=3.2.0 # Apache-2.0 13oslotest>=3.2.0 # Apache-2.0
14os-testr>=1.0.0 # Apache-2.0 14os-testr>=1.0.0 # Apache-2.0
15pylint==1.4.5 # GPLv2 15pylint==1.9.3;python_version=='2.7' # GPLv2
16pylint==2.1.1;python_version>='3.0' # GPLv2
16testresources>=2.0.0 # Apache-2.0/BSD 17testresources>=2.0.0 # Apache-2.0/BSD
17testscenarios>=0.4 # Apache-2.0/BSD 18testscenarios>=0.4 # Apache-2.0/BSD
18WebTest>=2.0.27 # MIT 19WebTest>=2.0.27 # MIT
diff --git a/tox.ini b/tox.ini
index a9f0414..80581dc 100644
--- a/tox.ini
+++ b/tox.ini
@@ -19,13 +19,14 @@ commands =
19passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY 19passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
20 20
21[testenv:pep8] 21[testenv:pep8]
22basepython = python2.7 22basepython = python3
23commands = flake8 23commands = flake8
24 {toxinidir}/tools/coding-checks.sh --pylint '{posargs}' 24 {toxinidir}/tools/coding-checks.sh --pylint '{posargs}'
25 doc8 doc/source devstack releasenotes/source vagrant rally-jobs 25 doc8 doc/source devstack releasenotes/source vagrant rally-jobs
26 neutron-db-manage --subproject=networking-ovn check_migration 26 neutron-db-manage --subproject=networking-ovn check_migration
27 27
28[testenv:venv] 28[testenv:venv]
29basepython = python3
29commands = {posargs} 30commands = {posargs}
30 31
31[testenv:functional] 32[testenv:functional]
@@ -66,7 +67,7 @@ commands =
66 {toxinidir}/tools/ostestr_compat_shim.sh {posargs} 67 {toxinidir}/tools/ostestr_compat_shim.sh {posargs}
67 68
68[testenv:cover] 69[testenv:cover]
69basepython = python2.7 70basepython = python3
70setenv = 71setenv =
71 {[testenv]setenv} 72 {[testenv]setenv}
72 PYTHON=coverage run --source networking_ovn --parallel-mode 73 PYTHON=coverage run --source networking_ovn --parallel-mode
@@ -78,7 +79,7 @@ commands =
78 coverage xml -o cover/coverage.xml 79 coverage xml -o cover/coverage.xml
79 80
80[testenv:docs] 81[testenv:docs]
81basepython = python2.7 82basepython = python3
82commands = 83commands =
83 rm -rf doc/build 84 rm -rf doc/build
84 doc8 doc/source devstack releasenotes/source vagrant rally-jobs 85 doc8 doc/source devstack releasenotes/source vagrant rally-jobs
@@ -95,6 +96,7 @@ commands =
95whitelist_externals = mkdir 96whitelist_externals = mkdir
96 97
97[testenv:releasenotes] 98[testenv:releasenotes]
99basepython = python3
98commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html 100commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
99 101
100[doc8] 102[doc8]