From 6372f73e4cfa9f167d3e335b64686b3f5a8fd62c Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sat, 21 Sep 2024 13:50:48 +0900 Subject: [PATCH] Bump hacking hacking 4.0.x is quite old. Bump it to the version currently used by neutron and neutron-lib. Change-Id: Iba06a77570f594911f1a150b707c15eb361ef9ca --- .pre-commit-config.yaml | 4 ++-- .../services/vpn/device_drivers/test_ipsec.py | 6 +++--- rally-jobs/plugins/vpn_base.py | 20 +++++++++---------- rally-jobs/plugins/vpn_utils.py | 2 +- requirements.txt | 1 - tox.ini | 4 ++-- 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7ef9dd253..8f020c43f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,8 +29,8 @@ repos: - id: flake8 name: flake8 additional_dependencies: - - hacking>=4.0.0,<4.1 - - flake8-import-order==0.18.1 + - hacking>=6.1.0,<6.2.0 + - flake8-import-order>=0.18.0,<0.19.0 - isort==4.3.21 language: python entry: flake8 diff --git a/neutron_vpnaas/tests/unit/services/vpn/device_drivers/test_ipsec.py b/neutron_vpnaas/tests/unit/services/vpn/device_drivers/test_ipsec.py index f7a4b9ff3..1ee60dd10 100644 --- a/neutron_vpnaas/tests/unit/services/vpn/device_drivers/test_ipsec.py +++ b/neutron_vpnaas/tests/unit/services/vpn/device_drivers/test_ipsec.py @@ -151,11 +151,11 @@ OPENSWAN_CONNECTION_DETAILS = '''# rightsubnet=networkA/netmaskA, networkB/netma # [lifetime_value] lifetime=%(life_time)ss # lifebytes=100000 if lifetime_units=kilobytes (IKEv2 only) -''' +''' # noqa: E501 IPV4_NEXT_HOP = '''# NOTE: a default route is required for %defaultroute to work... leftnexthop=%defaultroute - rightnexthop=%defaultroute''' + rightnexthop=%defaultroute''' # noqa: E501 IPV6_NEXT_HOP = '''# To recognize the given IP addresses in this config # as IPv6 addresses by pluto whack. Default is ipv4 @@ -310,7 +310,7 @@ PLUTO_MULTIPLE_SUBNETS_ESTABLISHED_STATUS = """000 "%(conn_id1)s/1x1": erouted;\ newest IPSEC;\n 000 "%(conn_id2)s/2x1": erouted;\n 000 #4: "%(conn_id2)s/2x1":500 STATE_QUICK_R2 (IPsec SA established); \ -newest IPSEC;\n""" % { +newest IPSEC;\n""" % { # noqa: E501 'conn_id1': FAKE_IPSEC_SITE_CONNECTION1_ID, 'conn_id2': FAKE_IPSEC_SITE_CONNECTION2_ID} PLUTO_ACTIVE_NO_IPSEC_SA_STATUS = """000 "%(conn_id)s/0x1": erouted;\n diff --git a/rally-jobs/plugins/vpn_base.py b/rally-jobs/plugins/vpn_base.py index 6cf83e1ca..d4e4e1aa3 100644 --- a/rally-jobs/plugins/vpn_base.py +++ b/rally-jobs/plugins/vpn_base.py @@ -102,7 +102,7 @@ class VpnBase(rally_base.OpenStackScenario): router["router"]["external_gateway_info"] ["external_fixed_ips"][0]["ip_address"]) - if(kwargs["DVR_flag"]): + if kwargs["DVR_flag"]: ns, controller = vpn_utils.wait_for_namespace_creation( "snat-", router["router"]['id'], kwargs['controller_creds'], @@ -137,7 +137,7 @@ class VpnBase(rally_base.OpenStackScenario): self.keypairs.append(keypair) self.server_private_ips.append(vpn_utils.get_server_ip( self.nova_client, server.id, self.suffixes[x])) - if(kwargs["DVR_flag"]): + if kwargs["DVR_flag"]: qrouter, compute = vpn_utils.wait_for_namespace_creation( "qrouter-", self.router_ids[x], kwargs['compute_creds'], @@ -163,8 +163,8 @@ class VpnBase(rally_base.OpenStackScenario): LOG.debug("VERIFY ROUTE EXISTS BETWEEN THE ROUTER GATEWAYS") for tuple in self.ns_controller_tuples: for ip in self.rally_router_gw_ips: - assert(vpn_utils.ping_router_gateway( - tuple, ip, self.private_key_file)), ( + assert vpn_utils.ping_router_gateway( + tuple, ip, self.private_key_file), ( "PING TO IP " + ip + " FAILED") @atomic.action_timer("_create_ike_policy") @@ -410,7 +410,7 @@ class VpnBase(rally_base.OpenStackScenario): tcpdump_future = e.submit(vpn_utils.start_tcpdump, self.ns_controller_tuples[peer_index], qg_interface, self.private_key_file) - if(kwargs["DVR_flag"]): + if kwargs["DVR_flag"]: ssh_future = e.submit( vpn_utils.ssh_and_ping_server, self.server_private_ips[local_index], @@ -426,7 +426,7 @@ class VpnBase(rally_base.OpenStackScenario): self.local_key_files[local_index], self.private_key_file) - assert(ssh_future.result()), "SSH/Ping failed" + assert ssh_future.result(), "SSH/Ping failed" for line in tcpdump_future.result(): if 'ESP' in line: return True @@ -437,11 +437,11 @@ class VpnBase(rally_base.OpenStackScenario): LOG.debug("VERIFY THE VPN CONNECTIVITY") with LOCK: - assert(self._verify_vpn_connectivity( - 0, 1, **kwargs)), "VPN CONNECTION FAILED" + assert self._verify_vpn_connectivity( + 0, 1, **kwargs), "VPN CONNECTION FAILED" with LOCK: - assert(self._verify_vpn_connectivity( - 1, 0, **kwargs)), "VPN CONNECTION FAILED" + assert self._verify_vpn_connectivity( + 1, 0, **kwargs), "VPN CONNECTION FAILED" def update_router(self, router_id, admin_state_up=False): """Update router's admin_state_up field diff --git a/rally-jobs/plugins/vpn_utils.py b/rally-jobs/plugins/vpn_utils.py index 2aa76bd48..936403114 100644 --- a/rally-jobs/plugins/vpn_utils.py +++ b/rally-jobs/plugins/vpn_utils.py @@ -306,7 +306,7 @@ def assert_server_status(server, **kwargs): timeout=kwargs["nova_server_boot_timeout"], check_interval=5) LOG.debug("SERVER STATUS: %s", server.status) - assert('ACTIVE' == server.status), ("THE INSTANCE IS NOT IN ACTIVE STATE") + assert ('ACTIVE' == server.status), ("THE INSTANCE IS NOT IN ACTIVE STATE") def get_server_ip(nova_client, server_id, network_suffix): diff --git a/requirements.txt b/requirements.txt index 07efe845d..18e271f79 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,6 @@ # Requirements lower bounds listed here are our best effort to keep them up to # date but we do not test them so no guarantee of having them all correct. If # you find any incorrect lower bounds, let us know or propose a fix. - pbr>=4.0.0 # Apache-2.0 Jinja2>=2.10 # BSD License (3 clause) diff --git a/tox.ini b/tox.ini index 1bd3ebe18..8574c1720 100644 --- a/tox.ini +++ b/tox.ini @@ -72,8 +72,8 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen [testenv:pep8] deps = {[testenv]deps} - hacking>=4.0.0,<4.1 # Apache-2.0 - flake8-import-order==0.18.1 # LGPLv3 + hacking>=6.1.0,<6.2.0 # Apache-2.0 + flake8-import-order>=0.18.0,<0.19.0 # LGPLv3 pylint==3.2.0 # GPLv2 isort==4.3.21 # MIT commands =