summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSushil Kumar <sushil.kumar2@globallogic.com>2013-12-12 03:55:50 +0000
committerGerrit Code Review <review@openstack.org>2013-12-14 15:16:20 +0000
commit953734d72752aaabe2f0c5f0526cf25a64b3a8b8 (patch)
treedbf42b1928fa78241e30956fa48d7deec2cb985e
parent3ecaeb416ed77de4033bf6839208788b9d5f066e (diff)
Enables H403 pep8 rules
Updates tox.ini to reduce ignored rules. Updates code for H403 violation. Change-Id: Iee7b34a27c62ce8cb0f26166b3c16e3386e2fecd
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: Kevin L. Mitchell <kevin.mitchell@rackspace.com> Approved+1: Joe Gordon <joe.gordon0@gmail.com> Code-Review+2: Joe Gordon <joe.gordon0@gmail.com> Submitted-by: Jenkins Submitted-at: Sat, 14 Dec 2013 18:10:13 +0000 Reviewed-on: https://review.openstack.org/61648 Project: openstack/python-novaclient Branch: refs/heads/master
-rw-r--r--novaclient/client.py3
-rw-r--r--novaclient/crypto.py3
-rw-r--r--novaclient/exceptions.py6
-rw-r--r--novaclient/service_catalog.py3
-rw-r--r--novaclient/v1_1/quota_classes.py3
-rw-r--r--novaclient/v1_1/quotas.py3
-rw-r--r--tox.ini2
7 files changed, 15 insertions, 8 deletions
diff --git a/novaclient/client.py b/novaclient/client.py
index 3cb1879..0ae8bb2 100644
--- a/novaclient/client.py
+++ b/novaclient/client.py
@@ -254,7 +254,8 @@ class HTTPClient(object):
254 def _extract_service_catalog(self, url, resp, body, extract_token=True): 254 def _extract_service_catalog(self, url, resp, body, extract_token=True):
255 """See what the auth service told us and process the response. 255 """See what the auth service told us and process the response.
256 We may get redirected to another site, fail or actually get 256 We may get redirected to another site, fail or actually get
257 back a service catalog with a token and our endpoints.""" 257 back a service catalog with a token and our endpoints.
258 """
258 259
259 # content must always present 260 # content must always present
260 if resp.status_code == 200 or resp.status_code == 201: 261 if resp.status_code == 200 or resp.status_code == 201:
diff --git a/novaclient/crypto.py b/novaclient/crypto.py
index a264823..d817be5 100644
--- a/novaclient/crypto.py
+++ b/novaclient/crypto.py
@@ -24,7 +24,8 @@ class DecryptionFailure(Exception):
24def decrypt_password(private_key, password): 24def decrypt_password(private_key, password):
25 """Base64 decodes password and unecrypts it with private key. 25 """Base64 decodes password and unecrypts it with private key.
26 26
27 Requires openssl binary available in the path""" 27 Requires openssl binary available in the path.
28 """
28 unencoded = base64.b64decode(password) 29 unencoded = base64.b64decode(password)
29 cmd = ['openssl', 'rsautl', '-decrypt', '-inkey', private_key] 30 cmd = ['openssl', 'rsautl', '-decrypt', '-inkey', private_key]
30 proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, 31 proc = subprocess.Popen(cmd, stdin=subprocess.PIPE,
diff --git a/novaclient/exceptions.py b/novaclient/exceptions.py
index 6ff93d7..73049cd 100644
--- a/novaclient/exceptions.py
+++ b/novaclient/exceptions.py
@@ -19,7 +19,8 @@ Exception definitions.
19 19
20class UnsupportedVersion(Exception): 20class UnsupportedVersion(Exception):
21 """Indicates that the user is trying to use an unsupported 21 """Indicates that the user is trying to use an unsupported
22 version of the API""" 22 version of the API.
23 """
23 pass 24 pass
24 25
25 26
@@ -46,7 +47,8 @@ class AuthSystemNotFound(Exception):
46 47
47class NoTokenLookupException(Exception): 48class NoTokenLookupException(Exception):
48 """This form of authentication does not support looking up 49 """This form of authentication does not support looking up
49 endpoints from an existing token.""" 50 endpoints from an existing token.
51 """
50 pass 52 pass
51 53
52 54
diff --git a/novaclient/service_catalog.py b/novaclient/service_catalog.py
index 2c4c997..26f4ccc 100644
--- a/novaclient/service_catalog.py
+++ b/novaclient/service_catalog.py
@@ -36,7 +36,8 @@ class ServiceCatalog(object):
36 service_name=None, volume_service_name=None): 36 service_name=None, volume_service_name=None):
37 """Fetch the public URL from the Compute service for 37 """Fetch the public URL from the Compute service for
38 a particular endpoint attribute. If none given, return 38 a particular endpoint attribute. If none given, return
39 the first. See tests for sample service catalog.""" 39 the first. See tests for sample service catalog.
40 """
40 matching_endpoints = [] 41 matching_endpoints = []
41 if 'endpoints' in self.catalog: 42 if 'endpoints' in self.catalog:
42 # We have a bastardized service catalog. Treat it special. :/ 43 # We have a bastardized service catalog. Treat it special. :/
diff --git a/novaclient/v1_1/quota_classes.py b/novaclient/v1_1/quota_classes.py
index 3f2908e..b57d707 100644
--- a/novaclient/v1_1/quota_classes.py
+++ b/novaclient/v1_1/quota_classes.py
@@ -21,7 +21,8 @@ class QuotaClassSet(base.Resource):
21 @property 21 @property
22 def id(self): 22 def id(self):
23 """QuotaClassSet does not have a 'id' attribute but base.Resource 23 """QuotaClassSet does not have a 'id' attribute but base.Resource
24 needs it to self-refresh and QuotaSet is indexed by class_name""" 24 needs it to self-refresh and QuotaSet is indexed by class_name.
25 """
25 return self.class_name 26 return self.class_name
26 27
27 def update(self, *args, **kwargs): 28 def update(self, *args, **kwargs):
diff --git a/novaclient/v1_1/quotas.py b/novaclient/v1_1/quotas.py
index bd5bd76..601bceb 100644
--- a/novaclient/v1_1/quotas.py
+++ b/novaclient/v1_1/quotas.py
@@ -21,7 +21,8 @@ class QuotaSet(base.Resource):
21 @property 21 @property
22 def id(self): 22 def id(self):
23 """QuotaSet does not have a 'id' attribute but base.Resource needs it 23 """QuotaSet does not have a 'id' attribute but base.Resource needs it
24 to self-refresh and QuotaSet is indexed by tenant_id""" 24 to self-refresh and QuotaSet is indexed by tenant_id.
25 """
25 return self.tenant_id 26 return self.tenant_id
26 27
27 def update(self, *args, **kwargs): 28 def update(self, *args, **kwargs):
diff --git a/tox.ini b/tox.ini
index 9ef68cc..d7d2b32 100644
--- a/tox.ini
+++ b/tox.ini
@@ -28,6 +28,6 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
28downloadcache = ~/cache/pip 28downloadcache = ~/cache/pip
29 29
30[flake8] 30[flake8]
31ignore = E12,F841,F811,F821,H302,H403,H404 31ignore = E12,F841,F811,F821,H302,H404
32show-source = True 32show-source = True
33exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build 33exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build