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
diff --git a/octavia_tempest_plugin/tests/validators.py b/octavia_tempest_plugin/tests/validators.py
index 34e8148..5ff7bd5 100644
--- a/octavia_tempest_plugin/tests/validators.py
+++ b/octavia_tempest_plugin/tests/validators.py
@@ -105,7 +105,7 @@
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 @@
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 @@
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 @@
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