From 8305f72ef2aee2d94267dd2f0268245fc6a3eb64 Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Wed, 12 Jun 2013 08:43:37 +1000 Subject: [PATCH] Fix H702 errors and enable them - Formatting operation should be outside of localization method call Change-Id: Icedbb98e46a52b53db7143a4111da13466a26847 --- heat/api/cfn/v1/stacks.py | 2 +- heat/common/auth.py | 2 +- heat/engine/parser.py | 7 ++++--- tox.ini | 3 +-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/heat/api/cfn/v1/stacks.py b/heat/api/cfn/v1/stacks.py index 7ca8ef6708..dab7ad4a8d 100644 --- a/heat/api/cfn/v1/stacks.py +++ b/heat/api/cfn/v1/stacks.py @@ -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) diff --git a/heat/common/auth.py b/heat/common/auth.py index 9d40a040bb..4064f1e9b0 100644 --- a/heat/common/auth.py +++ b/heat/common/auth.py @@ -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): diff --git a/heat/engine/parser.py b/heat/engine/parser.py index f0148a6b77..974b8eb1c0 100644 --- a/heat/engine/parser.py +++ b/heat/engine/parser.py @@ -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 7450f51446..46d7f085c6 100644 --- 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 = _