From d48d3587bd9593eb03ecec556eea3772b9c89d04 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 2 Sep 2013 21:39:21 +0200 Subject: [PATCH] Fix and enable Hacking H501 warning Enable Gating on H501. Fix the only two cases that trigger. Change-Id: Ib309b989df6556d7436e718e1497ce4dcacc83d6 --- heatclient/common/http.py | 6 ++++-- tox.ini | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/heatclient/common/http.py b/heatclient/common/http.py index 9fb06cb7..ecadd9f4 100644 --- a/heatclient/common/http.py +++ b/heatclient/common/http.py @@ -148,11 +148,13 @@ class HTTPClient(object): conn.request(method, conn_url, **kwargs) resp = conn.getresponse() except socket.gaierror as e: - message = "Error finding address for %(url)s: %(e)s" % locals() + message = ("Error finding address for %(url)s: %(e)s" % + {'url': url, 'e': e}) raise exc.InvalidEndpoint(message=message) except (socket.error, socket.timeout) as e: endpoint = self.endpoint - message = "Error communicating with %(endpoint)s %(e)s" % locals() + message = ("Error communicating with %(endpoint)s %(e)s" % + {'endpoint': endpoint, 'e': e}) raise exc.CommunicationError(message=message) body_iter = ResponseBodyIterator(resp) diff --git a/tox.ini b/tox.ini index 740724ce..7f09b5b7 100644 --- a/tox.ini +++ b/tox.ini @@ -22,6 +22,6 @@ downloadcache = ~/cache/pip [flake8] show-source = True -ignore = H233,H302,H501 +ignore = H233,H302 builtins = _ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build