diff --git a/novaclient/utils.py b/novaclient/utils.py
index 1bea47b6c..3fd9a182f 100644
--- a/novaclient/utils.py
+++ b/novaclient/utils.py
@@ -88,7 +88,9 @@ def get_resource_manager_extra_kwargs(f, args, allow_conflicts=False):
         conflicting_keys = set(hook_kwargs.keys()) & set(extra_kwargs.keys())
         if conflicting_keys and not allow_conflicts:
             raise Exception("Hook '%(hook_name)s' is attempting to redefine"
-                            " attributes '%(conflicting_keys)s'" % locals())
+                    " attributes '%(conflicting_keys)s'" %
+                    {'hook_name': hook_name,
+                        'conflicting_keys': conflicting_keys})
 
         extra_kwargs.update(hook_kwargs)
 
diff --git a/novaclient/v1_1/shell.py b/novaclient/v1_1/shell.py
index c044cf49d..b44107893 100644
--- a/novaclient/v1_1/shell.py
+++ b/novaclient/v1_1/shell.py
@@ -386,7 +386,7 @@ def _poll_for_status(poll_fn, obj_id, action, final_ok_states,
             break
         elif status == "error":
             if not silent:
-                print("\nError %(action)s instance" % locals())
+                print("\nError %s instance" % action)
             break
 
         if not silent:
diff --git a/novaclient/v3/shell.py b/novaclient/v3/shell.py
index 7358a87a9..39cf322ae 100644
--- a/novaclient/v3/shell.py
+++ b/novaclient/v3/shell.py
@@ -387,7 +387,7 @@ def _poll_for_status(poll_fn, obj_id, action, final_ok_states,
             break
         elif status == "error":
             if not silent:
-                print("\nError %(action)s instance" % locals())
+                print("\nError %s instance" % action)
             break
 
         if not silent:
diff --git a/tox.ini b/tox.ini
index e7e18c0d3..66c8f48f5 100644
--- a/tox.ini
+++ b/tox.ini
@@ -24,6 +24,6 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
 downloadcache = ~/cache/pip
 
 [flake8]
-ignore = E12,E711,E721,E712,F841,F811,F821,H102,H302,H306,H403,H404,H501
+ignore = E12,E711,E721,E712,F841,F811,F821,H102,H302,H306,H403,H404
 show-source = True
 exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build