Bump hacking

hacking 4.0.x is quite old. Bump it to the version currently used by
neutron and neutron-lib.

Change-Id: Iba06a77570f594911f1a150b707c15eb361ef9ca
This commit is contained in:
Takashi Kajinami 2024-09-21 13:50:48 +09:00
parent 7fda4c742b
commit 6372f73e4c
6 changed files with 18 additions and 19 deletions

View File

@ -29,8 +29,8 @@ repos:
- id: flake8 - id: flake8
name: flake8 name: flake8
additional_dependencies: additional_dependencies:
- hacking>=4.0.0,<4.1 - hacking>=6.1.0,<6.2.0
- flake8-import-order==0.18.1 - flake8-import-order>=0.18.0,<0.19.0
- isort==4.3.21 - isort==4.3.21
language: python language: python
entry: flake8 entry: flake8

View File

@ -151,11 +151,11 @@ OPENSWAN_CONNECTION_DETAILS = '''# rightsubnet=networkA/netmaskA, networkB/netma
# [lifetime_value] # [lifetime_value]
lifetime=%(life_time)ss lifetime=%(life_time)ss
# lifebytes=100000 if lifetime_units=kilobytes (IKEv2 only) # lifebytes=100000 if lifetime_units=kilobytes (IKEv2 only)
''' ''' # noqa: E501
IPV4_NEXT_HOP = '''# NOTE: a default route is required for %defaultroute to work... IPV4_NEXT_HOP = '''# NOTE: a default route is required for %defaultroute to work...
leftnexthop=%defaultroute leftnexthop=%defaultroute
rightnexthop=%defaultroute''' rightnexthop=%defaultroute''' # noqa: E501
IPV6_NEXT_HOP = '''# To recognize the given IP addresses in this config IPV6_NEXT_HOP = '''# To recognize the given IP addresses in this config
# as IPv6 addresses by pluto whack. Default is ipv4 # 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 newest IPSEC;\n
000 "%(conn_id2)s/2x1": erouted;\n 000 "%(conn_id2)s/2x1": erouted;\n
000 #4: "%(conn_id2)s/2x1":500 STATE_QUICK_R2 (IPsec SA established); \ 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_id1': FAKE_IPSEC_SITE_CONNECTION1_ID,
'conn_id2': FAKE_IPSEC_SITE_CONNECTION2_ID} 'conn_id2': FAKE_IPSEC_SITE_CONNECTION2_ID}
PLUTO_ACTIVE_NO_IPSEC_SA_STATUS = """000 "%(conn_id)s/0x1": erouted;\n PLUTO_ACTIVE_NO_IPSEC_SA_STATUS = """000 "%(conn_id)s/0x1": erouted;\n

View File

@ -102,7 +102,7 @@ class VpnBase(rally_base.OpenStackScenario):
router["router"]["external_gateway_info"] router["router"]["external_gateway_info"]
["external_fixed_ips"][0]["ip_address"]) ["external_fixed_ips"][0]["ip_address"])
if(kwargs["DVR_flag"]): if kwargs["DVR_flag"]:
ns, controller = vpn_utils.wait_for_namespace_creation( ns, controller = vpn_utils.wait_for_namespace_creation(
"snat-", router["router"]['id'], "snat-", router["router"]['id'],
kwargs['controller_creds'], kwargs['controller_creds'],
@ -137,7 +137,7 @@ class VpnBase(rally_base.OpenStackScenario):
self.keypairs.append(keypair) self.keypairs.append(keypair)
self.server_private_ips.append(vpn_utils.get_server_ip( self.server_private_ips.append(vpn_utils.get_server_ip(
self.nova_client, server.id, self.suffixes[x])) 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, compute = vpn_utils.wait_for_namespace_creation(
"qrouter-", self.router_ids[x], "qrouter-", self.router_ids[x],
kwargs['compute_creds'], kwargs['compute_creds'],
@ -163,8 +163,8 @@ class VpnBase(rally_base.OpenStackScenario):
LOG.debug("VERIFY ROUTE EXISTS BETWEEN THE ROUTER GATEWAYS") LOG.debug("VERIFY ROUTE EXISTS BETWEEN THE ROUTER GATEWAYS")
for tuple in self.ns_controller_tuples: for tuple in self.ns_controller_tuples:
for ip in self.rally_router_gw_ips: for ip in self.rally_router_gw_ips:
assert(vpn_utils.ping_router_gateway( assert vpn_utils.ping_router_gateway(
tuple, ip, self.private_key_file)), ( tuple, ip, self.private_key_file), (
"PING TO IP " + ip + " FAILED") "PING TO IP " + ip + " FAILED")
@atomic.action_timer("_create_ike_policy") @atomic.action_timer("_create_ike_policy")
@ -410,7 +410,7 @@ class VpnBase(rally_base.OpenStackScenario):
tcpdump_future = e.submit(vpn_utils.start_tcpdump, tcpdump_future = e.submit(vpn_utils.start_tcpdump,
self.ns_controller_tuples[peer_index], self.ns_controller_tuples[peer_index],
qg_interface, self.private_key_file) qg_interface, self.private_key_file)
if(kwargs["DVR_flag"]): if kwargs["DVR_flag"]:
ssh_future = e.submit( ssh_future = e.submit(
vpn_utils.ssh_and_ping_server, vpn_utils.ssh_and_ping_server,
self.server_private_ips[local_index], self.server_private_ips[local_index],
@ -426,7 +426,7 @@ class VpnBase(rally_base.OpenStackScenario):
self.local_key_files[local_index], self.local_key_files[local_index],
self.private_key_file) self.private_key_file)
assert(ssh_future.result()), "SSH/Ping failed" assert ssh_future.result(), "SSH/Ping failed"
for line in tcpdump_future.result(): for line in tcpdump_future.result():
if 'ESP' in line: if 'ESP' in line:
return True return True
@ -437,11 +437,11 @@ class VpnBase(rally_base.OpenStackScenario):
LOG.debug("VERIFY THE VPN CONNECTIVITY") LOG.debug("VERIFY THE VPN CONNECTIVITY")
with LOCK: with LOCK:
assert(self._verify_vpn_connectivity( assert self._verify_vpn_connectivity(
0, 1, **kwargs)), "VPN CONNECTION FAILED" 0, 1, **kwargs), "VPN CONNECTION FAILED"
with LOCK: with LOCK:
assert(self._verify_vpn_connectivity( assert self._verify_vpn_connectivity(
1, 0, **kwargs)), "VPN CONNECTION FAILED" 1, 0, **kwargs), "VPN CONNECTION FAILED"
def update_router(self, router_id, admin_state_up=False): def update_router(self, router_id, admin_state_up=False):
"""Update router's admin_state_up field """Update router's admin_state_up field

View File

@ -306,7 +306,7 @@ def assert_server_status(server, **kwargs):
timeout=kwargs["nova_server_boot_timeout"], timeout=kwargs["nova_server_boot_timeout"],
check_interval=5) check_interval=5)
LOG.debug("SERVER STATUS: %s", server.status) 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): def get_server_ip(nova_client, server_id, network_suffix):

View File

@ -1,7 +1,6 @@
# Requirements lower bounds listed here are our best effort to keep them up to # 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 # 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. # you find any incorrect lower bounds, let us know or propose a fix.
pbr>=4.0.0 # Apache-2.0 pbr>=4.0.0 # Apache-2.0
Jinja2>=2.10 # BSD License (3 clause) Jinja2>=2.10 # BSD License (3 clause)

View File

@ -72,8 +72,8 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen
[testenv:pep8] [testenv:pep8]
deps = deps =
{[testenv]deps} {[testenv]deps}
hacking>=4.0.0,<4.1 # Apache-2.0 hacking>=6.1.0,<6.2.0 # Apache-2.0
flake8-import-order==0.18.1 # LGPLv3 flake8-import-order>=0.18.0,<0.19.0 # LGPLv3
pylint==3.2.0 # GPLv2 pylint==3.2.0 # GPLv2
isort==4.3.21 # MIT isort==4.3.21 # MIT
commands = commands =