Remove locals() from cinder client code base
Hacking file now disallows locals() usage. Change-Id: I5049c718c2706d606c12913ae0b33a0fb3263542
This commit is contained in:
@@ -88,8 +88,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)
|
||||||
|
|
||||||
|
@@ -53,7 +53,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)
|
||||||
|
@@ -51,7 +51,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)
|
||||||
|
Reference in New Issue
Block a user