Browse Source

Enables H403 pep8 rules

Updates tox.ini to reduce ignored rules.

Updates code for H403 violation.

Change-Id: Iee7b34a27c62ce8cb0f26166b3c16e3386e2fecd
tags/2.16.0
Sushil Kumar 5 years ago
parent
commit
953734d727

+ 2
- 1
novaclient/client.py View File

@@ -254,7 +254,8 @@ class HTTPClient(object):
254 254
     def _extract_service_catalog(self, url, resp, body, extract_token=True):
255 255
         """See what the auth service told us and process the response.
256 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 260
         # content must always present
260 261
         if resp.status_code == 200 or resp.status_code == 201:

+ 2
- 1
novaclient/crypto.py View File

@@ -24,7 +24,8 @@ class DecryptionFailure(Exception):
24 24
 def decrypt_password(private_key, password):
25 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 29
     unencoded = base64.b64decode(password)
29 30
     cmd = ['openssl', 'rsautl', '-decrypt', '-inkey', private_key]
30 31
     proc = subprocess.Popen(cmd, stdin=subprocess.PIPE,

+ 4
- 2
novaclient/exceptions.py View File

@@ -19,7 +19,8 @@ Exception definitions.
19 19
 
20 20
 class UnsupportedVersion(Exception):
21 21
     """Indicates that the user is trying to use an unsupported
22
-    version of the API"""
22
+    version of the API.
23
+    """
23 24
     pass
24 25
 
25 26
 
@@ -46,7 +47,8 @@ class AuthSystemNotFound(Exception):
46 47
 
47 48
 class NoTokenLookupException(Exception):
48 49
     """This form of authentication does not support looking up
49
-       endpoints from an existing token."""
50
+       endpoints from an existing token.
51
+    """
50 52
     pass
51 53
 
52 54
 

+ 2
- 1
novaclient/service_catalog.py View File

@@ -36,7 +36,8 @@ class ServiceCatalog(object):
36 36
                     service_name=None, volume_service_name=None):
37 37
         """Fetch the public URL from the Compute service for
38 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 41
         matching_endpoints = []
41 42
         if 'endpoints' in self.catalog:
42 43
             # We have a bastardized service catalog. Treat it special. :/

+ 2
- 1
novaclient/v1_1/quota_classes.py View File

@@ -21,7 +21,8 @@ class QuotaClassSet(base.Resource):
21 21
     @property
22 22
     def id(self):
23 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 26
         return self.class_name
26 27
 
27 28
     def update(self, *args, **kwargs):

+ 2
- 1
novaclient/v1_1/quotas.py View File

@@ -21,7 +21,8 @@ class QuotaSet(base.Resource):
21 21
     @property
22 22
     def id(self):
23 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 26
         return self.tenant_id
26 27
 
27 28
     def update(self, *args, **kwargs):

+ 1
- 1
tox.ini View File

@@ -28,6 +28,6 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
28 28
 downloadcache = ~/cache/pip
29 29
 
30 30
 [flake8]
31
-ignore = E12,F841,F811,F821,H302,H403,H404
31
+ignore = E12,F841,F811,F821,H302,H404
32 32
 show-source = True
33 33
 exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build

Loading…
Cancel
Save