Browse Source

Fix and gate on H501, no locals for string formatting

Change-Id: I07e4a1a733639a343d4b3ee20927d50ba04bd7a3
Joe Gordon 5 years ago
parent
commit
e0e5c2dfe5
4 changed files with 6 additions and 4 deletions
  1. 3
    1
      novaclient/utils.py
  2. 1
    1
      novaclient/v1_1/shell.py
  3. 1
    1
      novaclient/v3/shell.py
  4. 1
    1
      tox.ini

+ 3
- 1
novaclient/utils.py View File

@@ -88,7 +88,9 @@ def get_resource_manager_extra_kwargs(f, args, allow_conflicts=False):
88 88
         conflicting_keys = set(hook_kwargs.keys()) & set(extra_kwargs.keys())
89 89
         if conflicting_keys and not allow_conflicts:
90 90
             raise Exception("Hook '%(hook_name)s' is attempting to redefine"
91
-                            " attributes '%(conflicting_keys)s'" % locals())
91
+                    " attributes '%(conflicting_keys)s'" %
92
+                    {'hook_name': hook_name,
93
+                        'conflicting_keys': conflicting_keys})
92 94
 
93 95
         extra_kwargs.update(hook_kwargs)
94 96
 

+ 1
- 1
novaclient/v1_1/shell.py View File

@@ -386,7 +386,7 @@ def _poll_for_status(poll_fn, obj_id, action, final_ok_states,
386 386
             break
387 387
         elif status == "error":
388 388
             if not silent:
389
-                print("\nError %(action)s instance" % locals())
389
+                print("\nError %s instance" % action)
390 390
             break
391 391
 
392 392
         if not silent:

+ 1
- 1
novaclient/v3/shell.py View File

@@ -387,7 +387,7 @@ def _poll_for_status(poll_fn, obj_id, action, final_ok_states,
387 387
             break
388 388
         elif status == "error":
389 389
             if not silent:
390
-                print("\nError %(action)s instance" % locals())
390
+                print("\nError %s instance" % action)
391 391
             break
392 392
 
393 393
         if not silent:

+ 1
- 1
tox.ini View File

@@ -24,6 +24,6 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
24 24
 downloadcache = ~/cache/pip
25 25
 
26 26
 [flake8]
27
-ignore = E12,E711,E721,E712,F841,F811,F821,H102,H302,H306,H403,H404,H501
27
+ignore = E12,E711,E721,E712,F841,F811,F821,H102,H302,H306,H403,H404
28 28
 show-source = True
29 29
 exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build

Loading…
Cancel
Save