Remove locals() from code base and enable H501 pep/flake rule
Change-Id: I104c70e053525e8c462e5bdbca733609303ee13b Related-Bug: #1333290
This commit is contained in:
parent
dc1926e9ad
commit
47d7a288a1
@ -72,8 +72,12 @@ def get_resource_manager_extra_kwargs(f, args, allow_conflicts=False):
|
|||||||
|
|
||||||
conflicting_keys = set(hook_kwargs.keys()) & set(extra_kwargs.keys())
|
conflicting_keys = set(hook_kwargs.keys()) & set(extra_kwargs.keys())
|
||||||
if conflicting_keys and not allow_conflicts:
|
if conflicting_keys and not allow_conflicts:
|
||||||
raise Exception("Hook '%(hook_name)s' is attempting to redefine"
|
msg = ("Hook '%(hook_name)s' is attempting to redefine attributes "
|
||||||
" attributes '%(conflicting_keys)s'" % locals())
|
"'%(conflicting_keys)s'" % {
|
||||||
|
'hook_name': hook_name,
|
||||||
|
'conflicting_keys': conflicting_keys,
|
||||||
|
})
|
||||||
|
raise Exception(msg)
|
||||||
|
|
||||||
extra_kwargs.update(hook_kwargs)
|
extra_kwargs.update(hook_kwargs)
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ def _poll_for_status(poll_fn, obj_id, action, final_ok_states,
|
|||||||
print("\nFinished")
|
print("\nFinished")
|
||||||
break
|
break
|
||||||
elif status == "error":
|
elif status == "error":
|
||||||
print("\nError %(action)s instance" % locals())
|
print("\nError %(action)s instance" % {'action': action})
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
print_progress(progress)
|
print_progress(progress)
|
||||||
|
2
tox.ini
2
tox.ini
@ -28,6 +28,6 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
|
|||||||
downloadcache = ~/cache/pip
|
downloadcache = ~/cache/pip
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
ignore = E12,H102,H501,F811,F821
|
ignore = E12,H102,F811,F821
|
||||||
builtins = _
|
builtins = _
|
||||||
exclude = .venv,.tox,dist,doc,openstack,*egg
|
exclude = .venv,.tox,dist,doc,openstack,*egg
|
||||||
|
Loading…
x
Reference in New Issue
Block a user