diff --git a/lower-constraints.txt b/lower-constraints.txt index 491dff6a0b5..2c22c6c5754 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -1,11 +1,12 @@ alabaster==0.7.10 -alembic==0.8.10 -amqp==2.1.1 +alembic==0.9.6 +amqp==2.5.0 appdirs==1.4.3 Babel==2.3.4 bashate==0.5.1 beautifulsoup4==4.6.0 cachetools==2.0.0 +cryptography<3.3 cffi==1.13.2 cliff==2.8.0 cmd2==0.8.0 @@ -19,7 +20,7 @@ doc8==0.6.0 docutils==0.11 dogpile.cache==0.6.5 dulwich==0.15.0 -eventlet==0.21.0 +eventlet==0.22.1 extras==1.0.0 fasteners==0.7.0 fixtures==3.0.0 @@ -57,11 +58,11 @@ os-client-config==1.28.0 os-ken==0.3.0 os-service-types==1.7.0 os-vif==1.15.1 -os-xenapi==0.3.1 +os-xenapi==0.3.4 osc-lib==1.8.0 oslo.cache==1.26.0 oslo.concurrency==3.26.0 -oslo.config==5.2.0 +oslo.config==6.0.0 oslo.context==2.22.0 oslo.db==4.44.0 oslo.i18n==3.20.0 @@ -73,7 +74,7 @@ oslo.privsep==2.3.0 oslo.reports==1.18.0 oslo.rootwrap==5.8.0 oslo.serialization==2.25.0 -oslo.service==1.24.0 +oslo.service==1.31.0 oslo.upgradecheck==0.1.0 oslo.utils==4.4.0 oslo.versionedobjects==1.35.1 @@ -100,7 +101,7 @@ pyOpenSSL==17.1.0 pyparsing==2.1.0 pyperclip==1.5.27 pyroute2==0.5.13 -python-dateutil==2.5.3 +python-dateutil==2.7.0 python-designateclient==2.7.0 python-editor==1.0.3 python-keystoneclient==3.8.0 @@ -109,7 +110,7 @@ python-neutronclient==6.7.0 python-novaclient==9.1.0 python-subunit==1.0.0 pytz==2013.6 -PyYAML==3.13 +PyYAML==5.3.1 reno==3.1.0 repoze.lru==0.7 requests==2.14.2 @@ -139,4 +140,4 @@ waitress==1.1.0 WebOb==1.8.2 WebTest==2.0.27 wmi==1.4.9 -wrapt==1.7.0 +wrapt==1.12.0 diff --git a/neutron/db/db_base_plugin_v2.py b/neutron/db/db_base_plugin_v2.py index eca38c76362..4b7d674d46e 100644 --- a/neutron/db/db_base_plugin_v2.py +++ b/neutron/db/db_base_plugin_v2.py @@ -255,7 +255,7 @@ class NeutronDbPluginV2(db_base_plugin_common.DbBasePluginCommon, ctx_admin, object_id=network_id, action='access_as_shared', target_tenant='*'): return - ports = ports.filter(models_v2.Port.tenant_id == tenant_id) + ports = ports.filter(models_v2.Port.project_id == tenant_id) if ports.count(): raise exc.InvalidSharedSetting(network=network_id) @@ -1425,20 +1425,20 @@ class NeutronDbPluginV2(db_base_plugin_common.DbBasePluginCommon, # Create the port db_port = self._create_db_port_obj(context, port_data) - p['mac_address'] = db_port['mac_address'] + p['mac_address'] = db_port.mac_address try: self.ipam.allocate_ips_for_port_and_store( context, port, port_id) - db_port['ip_allocation'] = (ipalloc_apidef. - IP_ALLOCATION_IMMEDIATE) + db_port.ip_allocation = (ipalloc_apidef. + IP_ALLOCATION_IMMEDIATE) except ipam_exc.DeferIpam: - db_port['ip_allocation'] = (ipalloc_apidef. - IP_ALLOCATION_DEFERRED) + db_port.ip_allocation = (ipalloc_apidef. + IP_ALLOCATION_DEFERRED) fixed_ips = p['fixed_ips'] if validators.is_attr_set(fixed_ips) and not fixed_ips: # [] was passed explicitly as fixed_ips. An unaddressed port. - db_port['ip_allocation'] = ipalloc_apidef.IP_ALLOCATION_NONE + db_port.ip_allocation = ipalloc_apidef.IP_ALLOCATION_NONE return db_port diff --git a/neutron/plugins/ml2/plugin.py b/neutron/plugins/ml2/plugin.py index eb0e579dbc1..b2ed3765d76 100644 --- a/neutron/plugins/ml2/plugin.py +++ b/neutron/plugins/ml2/plugin.py @@ -1556,7 +1556,7 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2, binding_host = pdata.get( portbindings.HOST_ID, const.ATTR_NOT_SPECIFIED) if binding_host != const.ATTR_NOT_SPECIFIED: - binding["host"] = binding_host + binding.host = binding_host mech_context = driver_context.PortContext(self, context, port_dict, network, binding, None) diff --git a/neutron/services/logapi/common/db_api.py b/neutron/services/logapi/common/db_api.py index d13058d8926..eb83591b228 100644 --- a/neutron/services/logapi/common/db_api.py +++ b/neutron/services/logapi/common/db_api.py @@ -48,7 +48,7 @@ def _get_ports_filter_in_tenant(context, tenant_id): ports = context.session.query( sg_db.SecurityGroupPortBinding.port_id).join( sg_db.SecurityGroup, sg_db.SecurityGroup.id == sg_id).filter( - sg_db.SecurityGroup.tenant_id == tenant_id).all() + sg_db.SecurityGroup.project_id == tenant_id).all() return list({port for (port,) in ports}) except orm_exc.NoResultFound: return [] diff --git a/neutron/services/metering/metering_plugin.py b/neutron/services/metering/metering_plugin.py index 6581fe2ee61..e4e630e5bb7 100644 --- a/neutron/services/metering/metering_plugin.py +++ b/neutron/services/metering/metering_plugin.py @@ -13,6 +13,7 @@ # under the License. import ipaddress + import netaddr from neutron_lib.agent import topics @@ -66,13 +67,11 @@ class MeteringPlugin(metering_db.MeteringDbMixin): def delete_metering_label(self, context, label_id): data = self.get_sync_data_metering(context, label_id) - label = super(MeteringPlugin, self).delete_metering_label( + super(MeteringPlugin, self).delete_metering_label( context, label_id) self.meter_rpc.remove_metering_label(context, data) - return label - def create_metering_label_rule(self, context, metering_label_rule): metering_label_rule = metering_label_rule['metering_label_rule'] MeteringPlugin.validate_metering_label_rule(metering_label_rule) diff --git a/neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovn_db_resources.py b/neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovn_db_resources.py index 7fcd10ab091..9c71c7c8e81 100644 --- a/neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovn_db_resources.py +++ b/neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovn_db_resources.py @@ -15,6 +15,7 @@ from unittest import mock import copy + import netaddr from neutron_lib.api.definitions import dns as dns_apidef from neutron_lib.utils import net as n_net diff --git a/neutron/tests/functional/requirements.txt b/neutron/tests/functional/requirements.txt index 67a39988a02..2d664cb354a 100644 --- a/neutron/tests/functional/requirements.txt +++ b/neutron/tests/functional/requirements.txt @@ -5,5 +5,4 @@ # process, which may cause wedges in the gate later. psycopg2 -psutil>=1.1.1,<3.2.2 PyMySQL>=0.6.2 # MIT License diff --git a/neutron/tests/unit/agent/dhcp/test_agent.py b/neutron/tests/unit/agent/dhcp/test_agent.py index ccd507a9ea8..006d458c830 100644 --- a/neutron/tests/unit/agent/dhcp/test_agent.py +++ b/neutron/tests/unit/agent/dhcp/test_agent.py @@ -1023,7 +1023,7 @@ class TestDhcpAgentEventHandler(base.BaseTestCase): method_path = ('neutron.agent.metadata.driver.MetadataDriver' '.spawn_monitored_metadata_proxy') with mock.patch(method_path) as spawn, \ - mock.patch.object(netutils, 'is_ipv6_enabled') as mock_ipv6: + mock.patch.object(netutils, 'is_ipv6_enabled') as mock_ipv6: mock_ipv6.return_value = True self.call_driver.return_value = 'fake-interface' self.dhcp.enable_isolated_metadata_proxy(network) diff --git a/neutron/tests/unit/agent/l3/test_agent.py b/neutron/tests/unit/agent/l3/test_agent.py index 4a97e0dedba..339d15d76ca 100644 --- a/neutron/tests/unit/agent/l3/test_agent.py +++ b/neutron/tests/unit/agent/l3/test_agent.py @@ -2668,9 +2668,9 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework): driver = metadata_driver.MetadataDriver with mock.patch.object( driver, 'destroy_monitored_metadata_proxy') as destroy_proxy, \ - mock.patch.object( - driver, 'spawn_monitored_metadata_proxy') as spawn_proxy, \ - mock.patch.object(netutils, 'is_ipv6_enabled') as ipv6_mock: + mock.patch.object( + driver, 'spawn_monitored_metadata_proxy') as spawn_proxy, \ + mock.patch.object(netutils, 'is_ipv6_enabled') as ipv6_mock: ipv6_mock.return_value = True agent._process_added_router(router) if enableflag: diff --git a/requirements.txt b/requirements.txt index 1214b5091f3..df01105a133 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ PasteDeploy>=1.5.0 # MIT Routes>=2.3.1 # MIT debtcollector>=1.19.0 # Apache-2.0 decorator>=3.4.0 # BSD -eventlet>=0.21.0 # MIT +eventlet>=0.22.1 # MIT pecan>=1.3.2 # BSD httplib2>=0.9.1 # MIT requests>=2.14.2 # Apache-2.0 @@ -22,11 +22,11 @@ tenacity>=6.0.0 # Apache-2.0 SQLAlchemy>=1.2.0 # MIT WebOb>=1.8.2 # MIT keystoneauth1>=3.14.0 # Apache-2.0 -alembic>=0.8.10 # MIT +alembic>=0.9.6 # MIT stevedore>=1.20.0 # Apache-2.0 oslo.cache>=1.26.0 # Apache-2.0 oslo.concurrency>=3.26.0 # Apache-2.0 -oslo.config>=5.2.0 # Apache-2.0 +oslo.config>=6.0.0 # Apache-2.0 oslo.context>=2.22.0 # Apache-2.0 oslo.db>=4.44.0 # Apache-2.0 oslo.i18n>=3.20.0 # Apache-2.0 @@ -38,7 +38,7 @@ oslo.privsep>=2.3.0 # Apache-2.0 oslo.reports>=1.18.0 # Apache-2.0 oslo.rootwrap>=5.8.0 # Apache-2.0 oslo.serialization>=2.25.0 # Apache-2.0 -oslo.service!=1.28.1,>=1.24.0 # Apache-2.0 +oslo.service>=1.31.0 # Apache-2.0 oslo.upgradecheck>=0.1.0 # Apache-2.0 oslo.utils>=4.4.0 # Apache-2.0 oslo.versionedobjects>=1.35.1 # Apache-2.0 @@ -54,7 +54,7 @@ pyOpenSSL>=17.1.0 # Apache-2.0 python-novaclient>=9.1.0 # Apache-2.0 openstacksdk>=0.31.2 # Apache-2.0 python-designateclient>=2.7.0 # Apache-2.0 -os-xenapi>=0.3.1 # Apache-2.0 +os-xenapi>=0.3.4 # Apache-2.0 os-vif>=1.15.1 # Apache-2.0 futurist>=1.2.0 # Apache-2.0 tooz>=1.58.0 # Apache-2.0 diff --git a/test-requirements.txt b/test-requirements.txt index b3ae9678830..1a0b5ddb898 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,7 +5,7 @@ hacking>=3.0.1,<3.1.0 # Apache-2.0 bandit!=1.6.0,>=1.1.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD -flake8-import-order==0.12 # LGPLv3 +flake8-import-order==0.18.1 # LGPLv3 python-subunit>=1.0.0 # Apache-2.0/BSD testtools>=2.2.0 # MIT testresources>=2.0.0 # Apache-2.0/BSD @@ -15,8 +15,8 @@ oslotest>=3.2.0 # Apache-2.0 stestr>=1.0.0 # Apache-2.0 reno>=3.1.0 # Apache-2.0 ddt>=1.0.1 # MIT -astroid==2.3.3 # LGPLv2.1 -pylint==2.4.4 # GPLv2 +astroid==2.4.0 # LGPLv2.1 +pylint==2.5.3 # GPLv2 isort==4.3.21 # MIT # Needed to run DB commands in virtualenvs PyMySQL>=0.7.6 # MIT License diff --git a/tox.ini b/tox.ini index 59d7db64dfa..576bd69e27a 100644 --- a/tox.ini +++ b/tox.ini @@ -153,11 +153,12 @@ commands = sphinx-build -W -b linkcheck doc/source doc/build/linkcheck # E126 continuation line over-indented for hanging indent # E128 continuation line under-indented for visual indent # H405 multi line docstring summary not separated with an empty line +# I202 Additional newline in a group of imports # N530 direct neutron imports not allowed # TODO(amotoki) check the following new rules should be fixed or ignored # E731 do not assign a lambda expression, use a def # W504 line break after binary operator -ignore = E126,E128,E731,H405,N530,W504 +ignore = E126,E128,E731,I202,H405,N530,W504 # H106: Don't put vim configuration in source files # H203: Use assertIs(Not)None to check for None # H204: Use assert(Not)Equal to check for equality