Bump hacking to newer version

Our hacking module is ancient and makes Python 3.6's f-strings to fail
PEP8 check. This commit bumps hacking to newer version and fixes
violations found by it.

Change-Id: If8769f7657676d71bcf84c08108e728836071425
This commit is contained in:
Michał Dulko 2020-02-21 12:00:03 +01:00
parent 8782ace4cc
commit 1045bcb02a
3 changed files with 5 additions and 6 deletions

View File

@ -349,7 +349,7 @@ def match_expressions(expressions, labels):
label_value = labels.get(str(exp['key']), None)
if exp_op == constants.K8S_OPERATOR_IN:
if label_value is None or label_value not in exp_values:
return False
return False
elif exp_op == constants.K8S_OPERATOR_NOT_IN:
if label_value in exp_values:
return False
@ -373,7 +373,7 @@ def match_labels(crd_labels, labels):
for crd_key, crd_value in crd_labels.items():
label_value = labels.get(crd_key, None)
if not label_value or crd_value != label_value:
return False
return False
return True

View File

@ -321,9 +321,8 @@ def get_endpoints_link(service):
link_parts = svc_link.split('/')
if link_parts[-2] != 'services':
raise exceptions.IntegrityError(_(
"Unsupported service link: %(link)s") % {
'link': svc_link})
raise exceptions.IntegrityError(
f"Unsupported service link: {svc_link}")
link_parts[-2] = 'endpoints'
return "/".join(link_parts)

View File

@ -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!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
hacking>=2.0.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
ddt>=1.0.1 # MIT