From bbfe30e4a40cce9aa1290143908ba361ba580972 Mon Sep 17 00:00:00 2001 From: "DODDA, PRATEEK REDDY (pd2839)" Date: Fri, 29 May 2020 18:02:11 -0500 Subject: [PATCH] Address PEP8 Failures in Armada Flake8 version recently updated to include new PEP8 rules. Some of the codebase is not compliant with the new rules. Change-Id: Ieb9de200535b6e3fd743e1c0f2e851e81cae79f3 --- armada/common/client.py | 3 +-- armada/exceptions/tiller_exceptions.py | 2 +- armada/handlers/document.py | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/armada/common/client.py b/armada/common/client.py index 184dfc8c..a3b188e0 100644 --- a/armada/common/client.py +++ b/armada/common/client.py @@ -154,8 +154,7 @@ class ArmadaClient(object): def _check_response(self, resp): if resp.status_code == 401: raise err.ClientUnauthorizedError( - "Unauthorized access to %s, include valid token.".format( - resp.url)) + "Unauthorized access to %s, include valid token." % resp.url) elif resp.status_code == 403: raise err.ClientForbiddenError("Forbidden access to %s" % resp.url) elif not resp.ok: diff --git a/armada/exceptions/tiller_exceptions.py b/armada/exceptions/tiller_exceptions.py index fcbd1a2b..6582b828 100644 --- a/armada/exceptions/tiller_exceptions.py +++ b/armada/exceptions/tiller_exceptions.py @@ -147,7 +147,7 @@ class GetReleaseContentException(TillerException): '''Exception that occurs during a failed Release Testing''' def __init__(self, release, version): - message = 'Failed to get {} content {} version {}'.format( + message = 'Failed to get {} content {} version'.format( release, version) super(GetReleaseContentException, self).__init__(message) diff --git a/armada/handlers/document.py b/armada/handlers/document.py index 04e33d44..c4777d55 100644 --- a/armada/handlers/document.py +++ b/armada/handlers/document.py @@ -46,10 +46,10 @@ class ReferenceResolver(object): if isinstance(design_ref, str): design_ref = [design_ref] - for l in design_ref: + for link in design_ref: try: - LOG.debug("Resolving reference %s." % l) - design_uri = urllib.parse.urlparse(l) + LOG.debug("Resolving reference %s." % link) + design_uri = urllib.parse.urlparse(link) # when scheme is a empty string assume it is a local # file path @@ -75,7 +75,7 @@ class ReferenceResolver(object): except ValueError: raise InvalidPathException( "Cannot resolve design reference %s: unable " - "to parse as valid URI." % l) + "to parse as valid URI." % link) return data