Update hacking
This patch updates the version of hacking to be consistent with octavia. It is also required for flake8 to understand f-strings correctly. Along with this version update, the patch fixes issues in the code found by the new versions. This patch also removes O349 check for importing mock since flake8 has added H216 which does the same check. Change-Id: I8e49fc19faff59b2811a7ee09b7ccaa286f73d82
This commit is contained in:
parent
b139fe94ae
commit
77b8baea5d
@ -73,7 +73,7 @@ class BarbicanClientManager(object):
|
||||
p12_secret.name = data_utils.rand_name("lb_member_barbican")
|
||||
p12_secret.payload = secret
|
||||
secret_ref = p12_secret.store()
|
||||
LOG.debug('Secret {0} has ref {1}'.format(p12_secret.name, secret_ref))
|
||||
LOG.debug('Secret %s has ref %s', p12_secret.name, secret_ref)
|
||||
return secret_ref
|
||||
|
||||
def delete_secret(self, secret_ref):
|
||||
@ -84,5 +84,5 @@ class BarbicanClientManager(object):
|
||||
users=[user_id],
|
||||
project_access=True)
|
||||
acl_ref = acl_entity.submit()
|
||||
LOG.debug('Secret ACL {0} added user {1}'.format(acl_ref, user_id))
|
||||
LOG.debug('Secret ACL %s added user %s', acl_ref, user_id)
|
||||
return acl_ref
|
||||
|
@ -66,8 +66,6 @@ untranslated_exception_re = re.compile(r"raise (?:\w*)\((.*)\)")
|
||||
no_eventlet_re = re.compile(r'(import|from)\s+[(]?eventlet')
|
||||
no_line_continuation_backslash_re = re.compile(r'.*(\\)\n')
|
||||
no_logging_re = re.compile(r'(import|from)\s+[(]?logging')
|
||||
import_mock_re = re.compile(r"\bimport[\s]+mock\b")
|
||||
import_from_mock_re = re.compile(r"\bfrom[\s]+mock[\s]+import\b")
|
||||
|
||||
|
||||
def _translation_checks_not_enforced(filename):
|
||||
@ -147,7 +145,7 @@ def no_log_warn(logical_line):
|
||||
O339
|
||||
"""
|
||||
if logical_line.startswith('LOG.warn('):
|
||||
yield(0, "O339:Use LOG.warning() rather than LOG.warn()")
|
||||
yield (0, "O339:Use LOG.warning() rather than LOG.warn()")
|
||||
|
||||
|
||||
@core.flake8ext
|
||||
@ -260,18 +258,3 @@ def check_no_logging_imports(logical_line):
|
||||
if no_logging_re.match(logical_line):
|
||||
msg = 'O348 Usage of Python logging module not allowed, use oslo_log'
|
||||
yield logical_line.index('logging'), msg
|
||||
|
||||
|
||||
@core.flake8ext
|
||||
def check_no_import_mock(logical_line):
|
||||
"""O349 - Test code must not import mock library.
|
||||
|
||||
:param logical_line: The logical line to check.
|
||||
:returns: None if the logical line passes the check, otherwise a tuple
|
||||
is yielded that contains the offending index in logical line
|
||||
and a message describe the check validation failure.
|
||||
"""
|
||||
if (import_mock_re.match(logical_line) or
|
||||
import_from_mock_re.match(logical_line)):
|
||||
msg = 'O349 Test code must not import mock library, use unittest.mock'
|
||||
yield 0, msg
|
||||
|
@ -69,7 +69,7 @@ class ActiveStandbyScenarioTest(test_base.LoadBalancerBaseTestWithCompute):
|
||||
floating_network_id=CONF.network.public_network_id,
|
||||
port_id=port_id)
|
||||
floating_ip = result['floatingip']
|
||||
LOG.info('lb1_floating_ip: {}'.format(floating_ip))
|
||||
LOG.info('lb1_floating_ip: %s', floating_ip)
|
||||
cls.addClassResourceCleanup(
|
||||
waiters.wait_for_not_found,
|
||||
cls.lb_mem_float_ip_client.delete_floatingip,
|
||||
|
@ -76,7 +76,7 @@ class ActiveStandbyIptablesScenarioTest(
|
||||
floating_network_id=CONF.network.public_network_id,
|
||||
port_id=port_id)
|
||||
floating_ip = result['floatingip']
|
||||
LOG.info('lb1_floating_ip: {}'.format(floating_ip))
|
||||
LOG.info('lb1_floating_ip: %s', floating_ip)
|
||||
cls.addClassResourceCleanup(
|
||||
waiters.wait_for_not_found,
|
||||
cls.lb_mem_float_ip_client.delete_floatingip,
|
||||
|
@ -568,8 +568,8 @@ class ListenerAPITest(test_base.LoadBalancerBaseTest):
|
||||
fs = e.resp_body.get('faultstring', '')
|
||||
if ("Invalid input for field/attribute protocol." in fs
|
||||
and "Value should be one of:" in fs):
|
||||
LOG.info("Skipping unsupported protocol: {}".format(
|
||||
listener_kwargs[const.PROTOCOL]))
|
||||
LOG.info("Skipping unsupported protocol: %s",
|
||||
listener_kwargs[const.PROTOCOL])
|
||||
else:
|
||||
raise e
|
||||
else:
|
||||
@ -598,8 +598,8 @@ class ListenerAPITest(test_base.LoadBalancerBaseTest):
|
||||
fs = e.resp_body.get('faultstring', '')
|
||||
if ("Invalid input for field/attribute protocol." in fs
|
||||
and "Value should be one of:" in fs):
|
||||
LOG.info("Skipping unsupported protocol: {}".format(
|
||||
listener_kwargs[const.PROTOCOL]))
|
||||
LOG.info("Skipping unsupported protocol: %s",
|
||||
listener_kwargs[const.PROTOCOL])
|
||||
else:
|
||||
raise e
|
||||
else:
|
||||
@ -646,8 +646,8 @@ class ListenerAPITest(test_base.LoadBalancerBaseTest):
|
||||
fs = e.resp_body.get('faultstring', '')
|
||||
if ("Invalid input for field/attribute protocol." in fs
|
||||
and "Value should be one of:" in fs):
|
||||
LOG.info("Skipping unsupported protocol: {}".format(
|
||||
listener_kwargs[const.PROTOCOL]))
|
||||
LOG.info("Skipping unsupported protocol: %s",
|
||||
listener_kwargs[const.PROTOCOL])
|
||||
else:
|
||||
raise e
|
||||
else:
|
||||
|
@ -29,6 +29,7 @@ from octavia_tempest_plugin.tests import waiters
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
# Member port numbers need to be unique on the shared pools so generate them
|
||||
@misc.singleton
|
||||
class MemberPort(object):
|
||||
|
@ -220,7 +220,7 @@ class TLSWithBarbicanTest(test_base.LoadBalancerBaseTestWithCompute):
|
||||
floating_network_id=CONF.network.public_network_id,
|
||||
port_id=port_id)
|
||||
floating_ip = result['floatingip']
|
||||
LOG.info('lb1_floating_ip: {}'.format(floating_ip))
|
||||
LOG.info('lb1_floating_ip: %s', floating_ip)
|
||||
cls.addClassResourceCleanup(
|
||||
waiters.wait_for_not_found,
|
||||
cls.lb_mem_float_ip_client.delete_floatingip,
|
||||
@ -349,9 +349,9 @@ class TLSWithBarbicanTest(test_base.LoadBalancerBaseTestWithCompute):
|
||||
# Make sure the certificate is the one we generated
|
||||
self.assertEqual(expected_cn, received_cn, message=msg)
|
||||
else:
|
||||
LOG.error('Certificate with CN: {0} failed validation with '
|
||||
'OpenSSL verify errno {1}'.format(
|
||||
x509.get_subject().commonName, errno))
|
||||
LOG.error('Certificate with CN: %s failed validation with '
|
||||
'OpenSSL verify errno %s',
|
||||
x509.get_subject().commonName, errno)
|
||||
return False
|
||||
return True
|
||||
|
||||
@ -487,9 +487,9 @@ class TLSWithBarbicanTest(test_base.LoadBalancerBaseTestWithCompute):
|
||||
# Make sure the certificate is the one we generated
|
||||
self.assertEqual(expected_cn, received_cn, message=msg)
|
||||
else:
|
||||
LOG.error('Certificate with CN: {0} failed validation with '
|
||||
'OpenSSL verify errno {1}'.format(
|
||||
x509.get_subject().commonName, errno))
|
||||
LOG.error('Certificate with CN: %s failed validation with '
|
||||
'OpenSSL verify errno %s',
|
||||
x509.get_subject().commonName, errno)
|
||||
return False
|
||||
return True
|
||||
|
||||
@ -660,9 +660,9 @@ class TLSWithBarbicanTest(test_base.LoadBalancerBaseTestWithCompute):
|
||||
# Make sure the certificate is the one we generated
|
||||
self.assertEqual(expected_cn, received_cn, message=msg)
|
||||
else:
|
||||
LOG.error('Certificate with CN: {0} failed validation with '
|
||||
'OpenSSL verify errno {1}'.format(
|
||||
x509.get_subject().commonName, errno))
|
||||
LOG.error('Certificate with CN: %s failed validation with '
|
||||
'OpenSSL verify errno %s',
|
||||
x509.get_subject().commonName, errno)
|
||||
return False
|
||||
return True
|
||||
|
||||
|
@ -79,7 +79,7 @@ class TrafficOperationsScenarioTest(test_base.LoadBalancerBaseTestWithCompute):
|
||||
floating_network_id=CONF.network.public_network_id,
|
||||
port_id=port_id)
|
||||
floating_ip = result['floatingip']
|
||||
LOG.info('lb1_floating_ip: {}'.format(floating_ip))
|
||||
LOG.info('lb1_floating_ip: %s', floating_ip)
|
||||
cls.addClassResourceCleanup(
|
||||
waiters.wait_for_not_found,
|
||||
cls.lb_mem_float_ip_client.delete_floatingip,
|
||||
@ -1351,7 +1351,7 @@ class TrafficOperationsScenarioTest(test_base.LoadBalancerBaseTestWithCompute):
|
||||
test_url = 'http://{}:{}/request'.format(
|
||||
self.lb_vip_address, listener_port)
|
||||
data = self.validate_URL_response(test_url)
|
||||
LOG.info('Received payload is: {}'.format(data))
|
||||
LOG.info('Received payload is: %s', data)
|
||||
|
||||
# Detect source IP that is used to create TCP socket toward LB_VIP.
|
||||
try:
|
||||
@ -1398,7 +1398,7 @@ class TrafficOperationsScenarioTest(test_base.LoadBalancerBaseTestWithCompute):
|
||||
|
||||
# Initiate HTTP traffic
|
||||
data = self.validate_URL_response(test_url)
|
||||
LOG.info('Received payload is: {}'.format(data))
|
||||
LOG.info('Received payload is: %s', data)
|
||||
expected_headers = {const.X_FORWARDED_PORT: '{}'.format(
|
||||
listener_port), const.X_FORWARDED_PROTO: const.HTTP.lower()}
|
||||
received_headers = _data_parser(data, expected_headers)
|
||||
@ -1550,7 +1550,7 @@ class TrafficOperationsScenarioTest(test_base.LoadBalancerBaseTestWithCompute):
|
||||
# For each test case, update HM and validate that members'
|
||||
# "Operation Status" is changed to expected value.
|
||||
for ff in flip_flop:
|
||||
LOG.info('Tested test case is: {}'.format(ff))
|
||||
LOG.info('Tested test case is: %s', ff)
|
||||
self.mem_healthmonitor_client.update_healthmonitor(
|
||||
hm_id, expected_codes=ff['code'], http_method=ff['mthd'],
|
||||
url_path=ff['url_path'])
|
||||
|
@ -82,7 +82,7 @@ class SparePoolTest(test_base.LoadBalancerBaseTestWithCompute):
|
||||
floating_network_id=CONF.network.public_network_id,
|
||||
port_id=port_id)
|
||||
floating_ip = result['floatingip']
|
||||
LOG.info('lb1_floating_ip: {}'.format(floating_ip))
|
||||
LOG.info('lb1_floating_ip: %s', floating_ip)
|
||||
self.addClassResourceCleanup(
|
||||
waiters.wait_for_not_found,
|
||||
self.lb_mem_float_ip_client.delete_floatingip,
|
||||
|
@ -364,31 +364,31 @@ class LoadBalancerBaseTest(validators.ValidatorsMixin,
|
||||
else:
|
||||
cls._create_networks()
|
||||
|
||||
LOG.debug('Octavia Setup: lb_member_vip_net = {}'.format(
|
||||
cls.lb_member_vip_net[const.ID]))
|
||||
LOG.debug('Octavia Setup: lb_member_vip_net = %s',
|
||||
cls.lb_member_vip_net[const.ID])
|
||||
if cls.lb_member_vip_subnet:
|
||||
LOG.debug('Octavia Setup: lb_member_vip_subnet = {}'.format(
|
||||
cls.lb_member_vip_subnet[const.ID]))
|
||||
LOG.debug('Octavia Setup: lb_member_1_net = {}'.format(
|
||||
cls.lb_member_1_net[const.ID]))
|
||||
LOG.debug('Octavia Setup: lb_member_vip_subnet = %s',
|
||||
cls.lb_member_vip_subnet[const.ID])
|
||||
LOG.debug('Octavia Setup: lb_member_1_net = %s',
|
||||
cls.lb_member_1_net[const.ID])
|
||||
if cls.lb_member_1_subnet:
|
||||
LOG.debug('Octavia Setup: lb_member_1_subnet = {}'.format(
|
||||
cls.lb_member_1_subnet[const.ID]))
|
||||
LOG.debug('Octavia Setup: lb_member_2_net = {}'.format(
|
||||
cls.lb_member_2_net[const.ID]))
|
||||
LOG.debug('Octavia Setup: lb_member_1_subnet = %s',
|
||||
cls.lb_member_1_subnet[const.ID])
|
||||
LOG.debug('Octavia Setup: lb_member_2_net = %s',
|
||||
cls.lb_member_2_net[const.ID])
|
||||
if cls.lb_member_2_subnet:
|
||||
LOG.debug('Octavia Setup: lb_member_2_subnet = {}'.format(
|
||||
cls.lb_member_2_subnet[const.ID]))
|
||||
LOG.debug('Octavia Setup: lb_member_2_subnet = %s',
|
||||
cls.lb_member_2_subnet[const.ID])
|
||||
if CONF.load_balancer.test_with_ipv6:
|
||||
if cls.lb_member_vip_ipv6_subnet:
|
||||
LOG.debug('Octavia Setup: lb_member_vip_ipv6_subnet = '
|
||||
'{}'.format(cls.lb_member_vip_ipv6_subnet[const.ID]))
|
||||
LOG.debug('Octavia Setup: lb_member_vip_ipv6_subnet = %s',
|
||||
cls.lb_member_vip_ipv6_subnet[const.ID])
|
||||
if cls.lb_member_1_ipv6_subnet:
|
||||
LOG.debug('Octavia Setup: lb_member_1_ipv6_subnet = {}'.format(
|
||||
cls.lb_member_1_ipv6_subnet[const.ID]))
|
||||
LOG.debug('Octavia Setup: lb_member_1_ipv6_subnet = %s',
|
||||
cls.lb_member_1_ipv6_subnet[const.ID])
|
||||
if cls.lb_member_2_ipv6_subnet:
|
||||
LOG.debug('Octavia Setup: lb_member_2_ipv6_subnet = {}'.format(
|
||||
cls.lb_member_2_ipv6_subnet[const.ID]))
|
||||
LOG.debug('Octavia Setup: lb_member_2_ipv6_subnet = %s',
|
||||
cls.lb_member_2_ipv6_subnet[const.ID])
|
||||
|
||||
@classmethod
|
||||
# Neutron can be slow to clean up ports from the subnets/networks.
|
||||
@ -403,8 +403,7 @@ class LoadBalancerBaseTest(validators.ValidatorsMixin,
|
||||
try:
|
||||
cls.lb_mem_net_client.delete_network(net_id)
|
||||
except Exception:
|
||||
LOG.error('Unable to delete network {}. Active ports:'.format(
|
||||
net_id))
|
||||
LOG.error('Unable to delete network %s. Active ports:', net_id)
|
||||
LOG.error(cls.lb_mem_ports_client.list_ports())
|
||||
raise
|
||||
|
||||
@ -421,8 +420,7 @@ class LoadBalancerBaseTest(validators.ValidatorsMixin,
|
||||
try:
|
||||
cls.lb_mem_subnet_client.delete_subnet(subnet_id)
|
||||
except Exception:
|
||||
LOG.error('Unable to delete subnet {}. Active ports:'.format(
|
||||
subnet_id))
|
||||
LOG.error('Unable to delete subnet %s. Active ports:', subnet_id)
|
||||
LOG.error(cls.lb_mem_ports_client.list_ports())
|
||||
raise
|
||||
|
||||
@ -450,7 +448,7 @@ class LoadBalancerBaseTest(validators.ValidatorsMixin,
|
||||
network_kwargs['port_security_enabled'] = True
|
||||
result = cls.lb_mem_net_client.create_network(**network_kwargs)
|
||||
cls.lb_member_vip_net = result['network']
|
||||
LOG.info('lb_member_vip_net: {}'.format(cls.lb_member_vip_net))
|
||||
LOG.info('lb_member_vip_net: %s', cls.lb_member_vip_net)
|
||||
cls.addClassResourceCleanup(
|
||||
waiters.wait_for_not_found,
|
||||
cls._logging_delete_network,
|
||||
@ -465,7 +463,7 @@ class LoadBalancerBaseTest(validators.ValidatorsMixin,
|
||||
'ip_version': 4}
|
||||
result = cls.lb_mem_subnet_client.create_subnet(**subnet_kwargs)
|
||||
cls.lb_member_vip_subnet = result['subnet']
|
||||
LOG.info('lb_member_vip_subnet: {}'.format(cls.lb_member_vip_subnet))
|
||||
LOG.info('lb_member_vip_subnet: %s', cls.lb_member_vip_subnet)
|
||||
cls.addClassResourceCleanup(
|
||||
waiters.wait_for_not_found,
|
||||
cls._logging_delete_subnet,
|
||||
@ -507,8 +505,8 @@ class LoadBalancerBaseTest(validators.ValidatorsMixin,
|
||||
cls.lb_mem_subnet_client.show_subnet,
|
||||
cls.lb_member_vip_ipv6_subnet['id'])
|
||||
|
||||
LOG.info('lb_member_vip_ipv6_subnet: {}'.format(
|
||||
cls.lb_member_vip_ipv6_subnet))
|
||||
LOG.info('lb_member_vip_ipv6_subnet: %s',
|
||||
cls.lb_member_vip_ipv6_subnet)
|
||||
|
||||
# Create tenant member 1 network
|
||||
network_kwargs = {
|
||||
@ -520,7 +518,7 @@ class LoadBalancerBaseTest(validators.ValidatorsMixin,
|
||||
network_kwargs['port_security_enabled'] = False
|
||||
result = cls.lb_mem_net_client.create_network(**network_kwargs)
|
||||
cls.lb_member_1_net = result['network']
|
||||
LOG.info('lb_member_1_net: {}'.format(cls.lb_member_1_net))
|
||||
LOG.info('lb_member_1_net: %s', cls.lb_member_1_net)
|
||||
cls.addClassResourceCleanup(
|
||||
waiters.wait_for_not_found,
|
||||
cls._logging_delete_network,
|
||||
@ -535,7 +533,7 @@ class LoadBalancerBaseTest(validators.ValidatorsMixin,
|
||||
'ip_version': 4}
|
||||
result = cls.lb_mem_subnet_client.create_subnet(**subnet_kwargs)
|
||||
cls.lb_member_1_subnet = result['subnet']
|
||||
LOG.info('lb_member_1_subnet: {}'.format(cls.lb_member_1_subnet))
|
||||
LOG.info('lb_member_1_subnet: %s', cls.lb_member_1_subnet)
|
||||
cls.addClassResourceCleanup(
|
||||
waiters.wait_for_not_found,
|
||||
cls._logging_delete_subnet,
|
||||
@ -553,10 +551,10 @@ class LoadBalancerBaseTest(validators.ValidatorsMixin,
|
||||
cls.lb_member_1_subnet_prefix = (
|
||||
CONF.load_balancer.member_1_ipv6_subnet_cidr.rpartition('/')[2]
|
||||
)
|
||||
assert(cls.lb_member_1_subnet_prefix.isdigit())
|
||||
assert (cls.lb_member_1_subnet_prefix.isdigit())
|
||||
cls.lb_member_1_ipv6_subnet = result['subnet']
|
||||
LOG.info('lb_member_1_ipv6_subnet: {}'.format(
|
||||
cls.lb_member_1_ipv6_subnet))
|
||||
LOG.info('lb_member_1_ipv6_subnet: %s',
|
||||
cls.lb_member_1_ipv6_subnet)
|
||||
cls.addClassResourceCleanup(
|
||||
waiters.wait_for_not_found,
|
||||
cls._logging_delete_subnet,
|
||||
@ -573,7 +571,7 @@ class LoadBalancerBaseTest(validators.ValidatorsMixin,
|
||||
network_kwargs['port_security_enabled'] = False
|
||||
result = cls.lb_mem_net_client.create_network(**network_kwargs)
|
||||
cls.lb_member_2_net = result['network']
|
||||
LOG.info('lb_member_2_net: {}'.format(cls.lb_member_2_net))
|
||||
LOG.info('lb_member_2_net: %s', cls.lb_member_2_net)
|
||||
cls.addClassResourceCleanup(
|
||||
waiters.wait_for_not_found,
|
||||
cls._logging_delete_network,
|
||||
@ -588,7 +586,7 @@ class LoadBalancerBaseTest(validators.ValidatorsMixin,
|
||||
'ip_version': 4}
|
||||
result = cls.lb_mem_subnet_client.create_subnet(**subnet_kwargs)
|
||||
cls.lb_member_2_subnet = result['subnet']
|
||||
LOG.info('lb_member_2_subnet: {}'.format(cls.lb_member_2_subnet))
|
||||
LOG.info('lb_member_2_subnet: %s', cls.lb_member_2_subnet)
|
||||
cls.addClassResourceCleanup(
|
||||
waiters.wait_for_not_found,
|
||||
cls._logging_delete_subnet,
|
||||
@ -606,10 +604,10 @@ class LoadBalancerBaseTest(validators.ValidatorsMixin,
|
||||
cls.lb_member_2_subnet_prefix = (
|
||||
CONF.load_balancer.member_2_ipv6_subnet_cidr.rpartition('/')[2]
|
||||
)
|
||||
assert(cls.lb_member_2_subnet_prefix.isdigit())
|
||||
assert (cls.lb_member_2_subnet_prefix.isdigit())
|
||||
cls.lb_member_2_ipv6_subnet = result['subnet']
|
||||
LOG.info('lb_member_2_ipv6_subnet: {}'.format(
|
||||
cls.lb_member_2_ipv6_subnet))
|
||||
LOG.info('lb_member_2_ipv6_subnet: %s',
|
||||
cls.lb_member_2_ipv6_subnet)
|
||||
cls.addClassResourceCleanup(
|
||||
waiters.wait_for_not_found,
|
||||
cls._logging_delete_subnet,
|
||||
@ -696,7 +694,7 @@ class LoadBalancerBaseTestWithCompute(LoadBalancerBaseTest):
|
||||
result = cls.lb_mem_keypairs_client.create_keypair(
|
||||
name=keypair_name)
|
||||
cls.lb_member_keypair = result['keypair']
|
||||
LOG.info('lb_member_keypair: {}'.format(cls.lb_member_keypair))
|
||||
LOG.info('lb_member_keypair: %s', cls.lb_member_keypair)
|
||||
cls.addClassResourceCleanup(
|
||||
waiters.wait_for_not_found,
|
||||
cls.lb_mem_keypairs_client.delete_keypair,
|
||||
@ -866,7 +864,7 @@ class LoadBalancerBaseTestWithCompute(LoadBalancerBaseTest):
|
||||
cls.lb_mem_SGr_client.show_security_group_rule,
|
||||
SGr['id'])
|
||||
|
||||
LOG.info('lb_member_sec_group: {}'.format(cls.lb_member_sec_group))
|
||||
LOG.info('lb_member_sec_group: %s', cls.lb_member_sec_group)
|
||||
|
||||
# Setup backend member reencryption PKI
|
||||
cls._create_backend_reencryption_pki()
|
||||
@ -880,14 +878,12 @@ class LoadBalancerBaseTestWithCompute(LoadBalancerBaseTest):
|
||||
cls.webserver1_ipv6 = server_details.get('ipv6_address')
|
||||
cls.webserver1_public_ip = server_details['public_ipv4_address']
|
||||
|
||||
LOG.debug('Octavia Setup: lb_member_webserver1 = {}'.format(
|
||||
cls.lb_member_webserver1[const.ID]))
|
||||
LOG.debug('Octavia Setup: webserver1_ip = {}'.format(
|
||||
cls.webserver1_ip))
|
||||
LOG.debug('Octavia Setup: webserver1_ipv6 = {}'.format(
|
||||
cls.webserver1_ipv6))
|
||||
LOG.debug('Octavia Setup: webserver1_public_ip = {}'.format(
|
||||
cls.webserver1_public_ip))
|
||||
LOG.debug('Octavia Setup: lb_member_webserver1 = %s',
|
||||
cls.lb_member_webserver1[const.ID])
|
||||
LOG.debug('Octavia Setup: webserver1_ip = %s', cls.webserver1_ip)
|
||||
LOG.debug('Octavia Setup: webserver1_ipv6 = %s', cls.webserver1_ipv6)
|
||||
LOG.debug('Octavia Setup: webserver1_public_ip = %s',
|
||||
cls.webserver1_public_ip)
|
||||
|
||||
# Create webserver 2 instance
|
||||
server_details = cls._create_webserver('lb_member_webserver2',
|
||||
@ -898,14 +894,12 @@ class LoadBalancerBaseTestWithCompute(LoadBalancerBaseTest):
|
||||
cls.webserver2_ipv6 = server_details.get('ipv6_address')
|
||||
cls.webserver2_public_ip = server_details['public_ipv4_address']
|
||||
|
||||
LOG.debug('Octavia Setup: lb_member_webserver2 = {}'.format(
|
||||
cls.lb_member_webserver2[const.ID]))
|
||||
LOG.debug('Octavia Setup: webserver2_ip = {}'.format(
|
||||
cls.webserver2_ip))
|
||||
LOG.debug('Octavia Setup: webserver2_ipv6 = {}'.format(
|
||||
cls.webserver2_ipv6))
|
||||
LOG.debug('Octavia Setup: webserver2_public_ip = {}'.format(
|
||||
cls.webserver2_public_ip))
|
||||
LOG.debug('Octavia Setup: lb_member_webserver2 = %s',
|
||||
cls.lb_member_webserver2[const.ID])
|
||||
LOG.debug('Octavia Setup: webserver2_ip = %s', cls.webserver2_ip)
|
||||
LOG.debug('Octavia Setup: webserver2_ipv6 = %s', cls.webserver2_ipv6)
|
||||
LOG.debug('Octavia Setup: webserver2_public_ip = %s',
|
||||
cls.webserver2_public_ip)
|
||||
|
||||
if CONF.load_balancer.test_with_ipv6:
|
||||
# Enable the IPv6 nic in webserver 1
|
||||
@ -954,7 +948,7 @@ class LoadBalancerBaseTestWithCompute(LoadBalancerBaseTest):
|
||||
external_gateway_info=dict(
|
||||
network_id=CONF.network.public_network_id))
|
||||
cls.lb_member_router = result['router']
|
||||
LOG.info('lb_member_router: {}'.format(cls.lb_member_router))
|
||||
LOG.info('lb_member_router: %s', cls.lb_member_router)
|
||||
cls.addClassResourceCleanup(
|
||||
waiters.wait_for_not_found,
|
||||
cls.lb_mem_routers_client.delete_router,
|
||||
@ -1069,7 +1063,7 @@ class LoadBalancerBaseTestWithCompute(LoadBalancerBaseTest):
|
||||
CONF.load_balancer.build_timeout,
|
||||
root_tag='server')
|
||||
webserver_details = {'server': server}
|
||||
LOG.info('Created server: {}'.format(server))
|
||||
LOG.info('Created server: %s', server)
|
||||
|
||||
addresses = server['addresses']
|
||||
if CONF.load_balancer.disable_boot_network:
|
||||
@ -1091,7 +1085,7 @@ class LoadBalancerBaseTestWithCompute(LoadBalancerBaseTest):
|
||||
floating_network_id=CONF.network.public_network_id,
|
||||
port_id=port_id)
|
||||
floating_ip = result['floatingip']
|
||||
LOG.info('webserver1_floating_ip: {}'.format(floating_ip))
|
||||
LOG.info('webserver1_floating_ip: %s', floating_ip)
|
||||
cls.addClassResourceCleanup(
|
||||
waiters.wait_for_not_found,
|
||||
cls.lb_mem_float_ip_client.delete_floatingip,
|
||||
@ -1126,7 +1120,7 @@ class LoadBalancerBaseTestWithCompute(LoadBalancerBaseTest):
|
||||
# the new default (SFTP protocol) doesn't work with
|
||||
# cirros VMs.
|
||||
ssh_version = cls._get_openssh_version()
|
||||
LOG.debug("ssh_version = {}".format(ssh_version))
|
||||
LOG.debug("ssh_version = %s", ssh_version)
|
||||
return (ssh_version[0] > 8 or
|
||||
(ssh_version[0] == 8 and ssh_version[1] >= 7))
|
||||
|
||||
|
@ -105,7 +105,7 @@ class ValidatorsMixin(test.BaseTestCase):
|
||||
return response_text
|
||||
except requests.exceptions.Timeout:
|
||||
# Don't sleep as we have already waited the interval.
|
||||
LOG.info('Request for {} timed out. Retrying.'.format(URL))
|
||||
LOG.info('Request for %s timed out. Retrying.', URL)
|
||||
except (exceptions.InvalidHttpSuccessCode,
|
||||
exceptions.InvalidHTTPResponseBody,
|
||||
requests.exceptions.SSLError):
|
||||
@ -113,8 +113,8 @@ class ValidatorsMixin(test.BaseTestCase):
|
||||
session.close()
|
||||
raise
|
||||
except Exception as e:
|
||||
LOG.info('Validate URL got exception: {0}. '
|
||||
'Retrying.'.format(e))
|
||||
LOG.info('Validate URL got exception: %s. '
|
||||
'Retrying.', e)
|
||||
time.sleep(request_interval)
|
||||
if requests_session is None:
|
||||
session.close()
|
||||
@ -443,8 +443,8 @@ class ValidatorsMixin(test.BaseTestCase):
|
||||
retry_number = 0
|
||||
received_data = None
|
||||
while retry_number < number_of_retries:
|
||||
LOG.info('make_udp_requests_with_retries attempt '
|
||||
'number:{}'.format(retry_number))
|
||||
LOG.info('make_udp_requests_with_retries attempt number: %s',
|
||||
retry_number)
|
||||
retry_number += 1
|
||||
try:
|
||||
received_data = self.make_udp_request(
|
||||
@ -452,6 +452,5 @@ class ValidatorsMixin(test.BaseTestCase):
|
||||
source_port=src_port)
|
||||
break
|
||||
except Exception as e:
|
||||
LOG.warning('make_udp_request has failed with: '
|
||||
'{}'.format(e))
|
||||
LOG.warning('make_udp_request has failed with: %s', e)
|
||||
return received_data
|
||||
|
@ -48,8 +48,8 @@ def wait_for_status(show_client, id, status_key, status,
|
||||
:returns: The object details from the show client.
|
||||
"""
|
||||
start = int(time.time())
|
||||
LOG.info('Waiting for {name} status to update to {status}'.format(
|
||||
name=show_client.__name__, status=status))
|
||||
LOG.info('Waiting for %s status to update to %s',
|
||||
show_client.__name__, status)
|
||||
while True:
|
||||
if status == const.DELETED:
|
||||
try:
|
||||
@ -65,8 +65,8 @@ def wait_for_status(show_client, id, status_key, status,
|
||||
object_details = response
|
||||
|
||||
if object_details[status_key] == status:
|
||||
LOG.info('{name}\'s status updated to {status}.'.format(
|
||||
name=show_client.__name__, status=status))
|
||||
LOG.info('%s\'s status updated to %s.',
|
||||
show_client.__name__, status)
|
||||
return object_details
|
||||
elif object_details[status_key] == 'ERROR' and not error_ok:
|
||||
message = ('{name} {field} updated to an invalid state of '
|
||||
@ -148,8 +148,8 @@ def wait_for_deleted_status_or_not_found(
|
||||
:returns: None
|
||||
"""
|
||||
start = int(time.time())
|
||||
LOG.info('Waiting for {name} status to update to DELETED or be not '
|
||||
'found(404)'.format(name=show_client.__name__))
|
||||
LOG.info('Waiting for %s status to update to DELETED or be not found(404)',
|
||||
show_client.__name__)
|
||||
while True:
|
||||
try:
|
||||
response = show_client(id, **kwargs)
|
||||
@ -162,8 +162,8 @@ def wait_for_deleted_status_or_not_found(
|
||||
object_details = response
|
||||
|
||||
if object_details[status_key] == const.DELETED:
|
||||
LOG.info('{name}\'s status updated to DELETED.'.format(
|
||||
name=show_client.__name__))
|
||||
LOG.info('%s\'s status updated to DELETED.',
|
||||
show_client.__name__)
|
||||
return
|
||||
elif int(time.time()) - start >= check_timeout:
|
||||
message = (
|
||||
|
@ -2,7 +2,7 @@
|
||||
# of appearance. Changing the order has an impact on the overall integration
|
||||
# process, which may cause wedges in the gate later.
|
||||
|
||||
hacking>=3.0.1,<3.1.0;python_version>='3.5' # Apache-2.0
|
||||
hacking>=6.1.0,<6.2.0 # Apache-2.0
|
||||
|
||||
coverage!=4.4,>=4.0 # Apache-2.0
|
||||
python-subunit>=1.0.0 # Apache-2.0/BSD
|
||||
|
Loading…
x
Reference in New Issue
Block a user