]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Fix H702 errors and enable them
authorAngus Salkeld <asalkeld@redhat.com>
Tue, 11 Jun 2013 22:43:37 +0000 (08:43 +1000)
committerAngus Salkeld <asalkeld@redhat.com>
Wed, 12 Jun 2013 02:50:09 +0000 (12:50 +1000)
 - Formatting operation should be outside of localization method call

Change-Id: Icedbb98e46a52b53db7143a4111da13466a26847

heat/api/cfn/v1/stacks.py
heat/common/auth.py
heat/engine/parser.py
tox.ini

index 7ca8ef670882c4fc32483a14421419c4f06e2900..dab7ad4a8ddf0b46fde97b0231817d0f3f9ccfd0 100644 (file)
@@ -291,7 +291,7 @@ class StackController(object):
             return result
 
         if action not in self.CREATE_OR_UPDATE_ACTION:
-            msg = _("Unexpected action %s" % action)
+            msg = _('Unexpected action %s') % action
             # This should not happen, so return HeatInternalFailureError
             return exception.HeatInternalFailureError(detail=msg)
 
index 9d40a040bbf832f02c4979ea0423cbde0c05ca08..4064f1e9b06807a27b830f2cd93b6a9373461014 100644 (file)
@@ -176,7 +176,7 @@ class KeystoneStrategy(BaseStrategy):
         elif resp.status == 404:
             raise exception.AuthUrlNotFound(url=token_url)
         else:
-            raise Exception(_('Unexpected response: %s' % resp.status))
+            raise Exception(_('Unexpected response: %s') % resp.status)
 
     def _v2_auth(self, token_url):
         def get_endpoint(service_catalog):
index f0148a6b770a7ac29952063af9a49fd6bcbe91ed..974b8eb1c0b5bf66c73e8f564d7954bf45b4b4ae 100644 (file)
@@ -74,9 +74,10 @@ class Stack(object):
         '''
 
         if re.match("[a-zA-Z][a-zA-Z0-9_.-]*$", stack_name) is None:
-            raise ValueError(_("Invalid stack name %s" % stack_name
-                               + ", must contain only alphanumeric or "
-                               + "\"_-.\" characters, must start with alpha"))
+            raise ValueError(_('Invalid stack name %s'
+                               ' must contain only alphanumeric or '
+                               '\"_-.\" characters, must start with alpha'
+                               ) % stack_name)
 
         self.id = stack_id
         self.context = context
diff --git a/tox.ini b/tox.ini
index 7450f514468346ffa952974516f4eb0f5671d754..46d7f085c6fd7862262677b0a1b10e3d93c87ed2 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -22,7 +22,7 @@ commands =
   python setup.py testr --coverage
 
 [flake8]
-ignore = F403,F841,H201,H302,H303,H306,H404,H702,H703
+ignore = F403,F841,H201,H302,H303,H306,H404,H703
 # F403 'from sqlalchemy import *' used; unable to detect undefined names
 # F841 local variable 'json_template' is assigned to but never used
 # H201 no 'except:' at least use 'except Exception:'
@@ -30,7 +30,6 @@ ignore = F403,F841,H201,H302,H303,H306,H404,H702,H703
 # H303 No wildcard (*) import.
 # H306 imports not in alphabetical order
 # H404 multi line docstring should start with a summary
-# H702 Formatting operation should be outside of localization method call
 # H703 Multiple positional placeholders
 show-source = true
 builtins = _