Browse Source

Enables H306 pep8 rules

Updates tox.ini to reduce ignored rules.

Updates code for H306 violation.

Change-Id: I9beea02510a1122afb55ad3df3b37f770fe05134
Sushil Kumar 5 years ago
parent
commit
3ecaeb416e
39 changed files with 57 additions and 55 deletions
  1. 1
    1
      novaclient/client.py
  2. 1
    1
      novaclient/tests/test_auth_plugins.py
  3. 1
    1
      novaclient/tests/test_base.py
  4. 1
    1
      novaclient/tests/test_client.py
  5. 2
    1
      novaclient/tests/test_discover.py
  6. 2
    2
      novaclient/tests/test_utils.py
  7. 1
    1
      novaclient/tests/v1_1/contrib/fakes.py
  8. 1
    1
      novaclient/tests/v1_1/fakes.py
  9. 2
    2
      novaclient/tests/v1_1/test_agents.py
  10. 1
    1
      novaclient/tests/v1_1/test_aggregates.py
  11. 2
    2
      novaclient/tests/v1_1/test_auth.py
  12. 2
    2
      novaclient/tests/v1_1/test_availability_zone.py
  13. 1
    1
      novaclient/tests/v1_1/test_certs.py
  14. 1
    1
      novaclient/tests/v1_1/test_cloudpipe.py
  15. 1
    1
      novaclient/tests/v1_1/test_fixed_ips.py
  16. 1
    1
      novaclient/tests/v1_1/test_flavor_access.py
  17. 1
    1
      novaclient/tests/v1_1/test_flavors.py
  18. 2
    2
      novaclient/tests/v1_1/test_floating_ip_dns.py
  19. 1
    1
      novaclient/tests/v1_1/test_floating_ip_pools.py
  20. 1
    1
      novaclient/tests/v1_1/test_floating_ips.py
  21. 2
    1
      novaclient/tests/v1_1/test_floating_ips_bulk.py
  22. 1
    1
      novaclient/tests/v1_1/test_fping.py
  23. 2
    2
      novaclient/tests/v1_1/test_hosts.py
  24. 1
    1
      novaclient/tests/v1_1/test_images.py
  25. 1
    1
      novaclient/tests/v1_1/test_keypairs.py
  26. 1
    1
      novaclient/tests/v1_1/test_limits.py
  27. 1
    1
      novaclient/tests/v1_1/test_networks.py
  28. 1
    1
      novaclient/tests/v1_1/test_security_group_rules.py
  29. 1
    1
      novaclient/tests/v1_1/test_security_groups.py
  30. 1
    1
      novaclient/tests/v1_1/test_servers.py
  31. 2
    2
      novaclient/tests/v1_1/test_services.py
  32. 2
    2
      novaclient/tests/v1_1/test_shell.py
  33. 1
    1
      novaclient/tests/v1_1/test_usage.py
  34. 1
    1
      novaclient/tests/v1_1/test_volumes.py
  35. 1
    1
      novaclient/tests/v3/fakes.py
  36. 2
    2
      novaclient/tests/v3/test_hosts.py
  37. 8
    8
      novaclient/v1_1/client.py
  38. 1
    1
      novaclient/v1_1/flavors.py
  39. 1
    1
      tox.ini

+ 1
- 1
novaclient/client.py View File

@@ -31,9 +31,9 @@ except ImportError:
31 31
     import simplejson as json
32 32
 
33 33
 from novaclient import exceptions
34
+from novaclient.openstack.common.py3kcompat import urlutils
34 35
 from novaclient import service_catalog
35 36
 from novaclient import utils
36
-from novaclient.openstack.common.py3kcompat import urlutils
37 37
 
38 38
 
39 39
 class HTTPClient(object):

+ 1
- 1
novaclient/tests/test_auth_plugins.py View File

@@ -25,8 +25,8 @@ except ImportError:
25 25
 
26 26
 from novaclient import auth_plugin
27 27
 from novaclient import exceptions
28
-from novaclient.v1_1 import client
29 28
 from novaclient.tests import utils
29
+from novaclient.v1_1 import client
30 30
 
31 31
 
32 32
 def mock_http_request(resp=None):

+ 1
- 1
novaclient/tests/test_base.py View File

@@ -13,9 +13,9 @@
13 13
 
14 14
 from novaclient import base
15 15
 from novaclient import exceptions
16
-from novaclient.v1_1 import flavors
17 16
 from novaclient.tests import utils
18 17
 from novaclient.tests.v1_1 import fakes
18
+from novaclient.v1_1 import flavors
19 19
 
20 20
 
21 21
 cs = fakes.FakeClient()

+ 1
- 1
novaclient/tests/test_client.py View File

@@ -20,9 +20,9 @@ import requests
20 20
 import novaclient.client
21 21
 import novaclient.extension
22 22
 import novaclient.tests.fakes as fakes
23
+from novaclient.tests import utils
23 24
 import novaclient.v1_1.client
24 25
 import novaclient.v3.client
25
-from novaclient.tests import utils
26 26
 
27 27
 import json
28 28
 

+ 2
- 1
novaclient/tests/test_discover.py View File

@@ -13,9 +13,10 @@
13 13
 #    License for the specific language governing permissions and limitations
14 14
 #    under the License.
15 15
 
16
-import mock
17 16
 import imp
18 17
 import inspect
18
+
19
+import mock
19 20
 import pkg_resources
20 21
 
21 22
 import novaclient.shell

+ 2
- 2
novaclient/tests/test_utils.py View File

@@ -16,10 +16,10 @@ import sys
16 16
 import mock
17 17
 import six
18 18
 
19
-from novaclient import exceptions
20
-from novaclient import utils
21 19
 from novaclient import base
20
+from novaclient import exceptions
22 21
 from novaclient.tests import utils as test_utils
22
+from novaclient import utils
23 23
 
24 24
 UUID = '8e8ec658-c7b0-4243-bdf8-6f7f2952c0d0'
25 25
 

+ 1
- 1
novaclient/tests/v1_1/contrib/fakes.py View File

@@ -12,8 +12,8 @@
12 12
 # See the License for the specific language governing permissions and
13 13
 # limitations under the License.
14 14
 
15
-from novaclient.v1_1 import client
16 15
 from novaclient.tests.v1_1 import fakes
16
+from novaclient.v1_1 import client
17 17
 
18 18
 
19 19
 class FakeClient(fakes.FakeClient):

+ 1
- 1
novaclient/tests/v1_1/fakes.py View File

@@ -20,8 +20,8 @@ import six
20 20
 
21 21
 from novaclient import client as base_client
22 22
 from novaclient import exceptions
23
-from novaclient.openstack.common import strutils
24 23
 from novaclient.openstack.common.py3kcompat import urlutils
24
+from novaclient.openstack.common import strutils
25 25
 from novaclient.tests import fakes
26 26
 from novaclient.tests import utils
27 27
 from novaclient.v1_1 import client

+ 2
- 2
novaclient/tests/v1_1/test_agents.py View File

@@ -15,9 +15,9 @@
15 15
 #    License for the specific language governing permissions and limitations
16 16
 #    under the License.
17 17
 
18
-from novaclient.v1_1 import agents
19
-from novaclient.tests.v1_1 import fakes
20 18
 from novaclient.tests import utils
19
+from novaclient.tests.v1_1 import fakes
20
+from novaclient.v1_1 import agents
21 21
 
22 22
 
23 23
 cs = fakes.FakeClient()

+ 1
- 1
novaclient/tests/v1_1/test_aggregates.py View File

@@ -13,9 +13,9 @@
13 13
 #    License for the specific language governing permissions and limitations
14 14
 #    under the License.
15 15
 
16
-from novaclient.v1_1 import aggregates
17 16
 from novaclient.tests import utils
18 17
 from novaclient.tests.v1_1 import fakes
18
+from novaclient.v1_1 import aggregates
19 19
 
20 20
 
21 21
 cs = fakes.FakeClient()

+ 2
- 2
novaclient/tests/v1_1/test_auth.py View File

@@ -13,13 +13,13 @@
13 13
 
14 14
 import copy
15 15
 import json
16
-import mock
17 16
 
17
+import mock
18 18
 import requests
19 19
 
20
-from novaclient.v1_1 import client
21 20
 from novaclient import exceptions
22 21
 from novaclient.tests import utils
22
+from novaclient.v1_1 import client
23 23
 
24 24
 
25 25
 class AuthenticateAgainstKeystoneTests(utils.TestCase):

+ 2
- 2
novaclient/tests/v1_1/test_availability_zone.py View File

@@ -16,10 +16,10 @@
16 16
 
17 17
 import six
18 18
 
19
+from novaclient.tests import utils
20
+from novaclient.tests.v1_1 import fakes
19 21
 from novaclient.v1_1 import availability_zones
20 22
 from novaclient.v1_1 import shell
21
-from novaclient.tests.v1_1 import fakes
22
-from novaclient.tests import utils
23 23
 
24 24
 
25 25
 cs = fakes.FakeClient()

+ 1
- 1
novaclient/tests/v1_1/test_certs.py View File

@@ -11,9 +11,9 @@
11 11
 #    License for the specific language governing permissions and limitations
12 12
 #    under the License.
13 13
 
14
-from novaclient.v1_1 import certs
15 14
 from novaclient.tests import utils
16 15
 from novaclient.tests.v1_1 import fakes
16
+from novaclient.v1_1 import certs
17 17
 
18 18
 
19 19
 cs = fakes.FakeClient()

+ 1
- 1
novaclient/tests/v1_1/test_cloudpipe.py View File

@@ -11,9 +11,9 @@
11 11
 #    License for the specific language governing permissions and limitations
12 12
 #    under the License.
13 13
 
14
-from novaclient.v1_1 import cloudpipe
15 14
 from novaclient.tests import utils
16 15
 from novaclient.tests.v1_1 import fakes
16
+from novaclient.v1_1 import cloudpipe
17 17
 
18 18
 
19 19
 cs = fakes.FakeClient()

+ 1
- 1
novaclient/tests/v1_1/test_fixed_ips.py View File

@@ -15,8 +15,8 @@
15 15
 #    License for the specific language governing permissions and limitations
16 16
 #    under the License.
17 17
 
18
-from novaclient.tests.v1_1 import fakes
19 18
 from novaclient.tests import utils
19
+from novaclient.tests.v1_1 import fakes
20 20
 
21 21
 cs = fakes.FakeClient()
22 22
 

+ 1
- 1
novaclient/tests/v1_1/test_flavor_access.py View File

@@ -13,9 +13,9 @@
13 13
 #    License for the specific language governing permissions and limitations
14 14
 #    under the License.
15 15
 
16
-from novaclient.v1_1 import flavor_access
17 16
 from novaclient.tests import utils
18 17
 from novaclient.tests.v1_1 import fakes
18
+from novaclient.v1_1 import flavor_access
19 19
 
20 20
 
21 21
 cs = fakes.FakeClient()

+ 1
- 1
novaclient/tests/v1_1/test_flavors.py View File

@@ -14,9 +14,9 @@
14 14
 #    under the License.
15 15
 
16 16
 from novaclient import exceptions
17
-from novaclient.v1_1 import flavors
18 17
 from novaclient.tests import utils
19 18
 from novaclient.tests.v1_1 import fakes
19
+from novaclient.v1_1 import flavors
20 20
 
21 21
 
22 22
 cs = fakes.FakeClient()

+ 2
- 2
novaclient/tests/v1_1/test_floating_ip_dns.py View File

@@ -11,9 +11,9 @@
11 11
 #    License for the specific language governing permissions and limitations
12 12
 #    under the License.
13 13
 
14
-from novaclient.v1_1 import floating_ip_dns
15
-from novaclient.tests.v1_1 import fakes
16 14
 from novaclient.tests import utils
15
+from novaclient.tests.v1_1 import fakes
16
+from novaclient.v1_1 import floating_ip_dns
17 17
 
18 18
 
19 19
 cs = fakes.FakeClient()

+ 1
- 1
novaclient/tests/v1_1/test_floating_ip_pools.py View File

@@ -14,9 +14,9 @@
14 14
 #    License for the specific language governing permissions and limitations
15 15
 #    under the License.
16 16
 
17
-from novaclient.v1_1 import floating_ip_pools
18 17
 from novaclient.tests import utils
19 18
 from novaclient.tests.v1_1 import fakes
19
+from novaclient.v1_1 import floating_ip_pools
20 20
 
21 21
 
22 22
 cs = fakes.FakeClient()

+ 1
- 1
novaclient/tests/v1_1/test_floating_ips.py View File

@@ -14,9 +14,9 @@
14 14
 #    License for the specific language governing permissions and limitations
15 15
 #    under the License.
16 16
 
17
-from novaclient.v1_1 import floating_ips
18 17
 from novaclient.tests import utils
19 18
 from novaclient.tests.v1_1 import fakes
19
+from novaclient.v1_1 import floating_ips
20 20
 
21 21
 
22 22
 cs = fakes.FakeClient()

+ 2
- 1
novaclient/tests/v1_1/test_floating_ips_bulk.py View File

@@ -14,9 +14,10 @@
14 14
 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 15
 #    License for the specific language governing permissions and limitations
16 16
 #    under the License.
17
-from novaclient.v1_1 import floating_ips_bulk
17
+
18 18
 from novaclient.tests import utils
19 19
 from novaclient.tests.v1_1 import fakes
20
+from novaclient.v1_1 import floating_ips_bulk
20 21
 
21 22
 
22 23
 cs = fakes.FakeClient()

+ 1
- 1
novaclient/tests/v1_1/test_fping.py View File

@@ -15,9 +15,9 @@
15 15
 #    License for the specific language governing permissions and limitations
16 16
 #    under the License.
17 17
 
18
-from novaclient.v1_1 import fping
19 18
 from novaclient.tests import utils
20 19
 from novaclient.tests.v1_1 import fakes
20
+from novaclient.v1_1 import fping
21 21
 
22 22
 
23 23
 cs = fakes.FakeClient()

+ 2
- 2
novaclient/tests/v1_1/test_hosts.py View File

@@ -11,9 +11,9 @@
11 11
 #    License for the specific language governing permissions and limitations
12 12
 #    under the License.
13 13
 
14
-from novaclient.v1_1 import hosts
15
-from novaclient.tests.v1_1 import fakes
16 14
 from novaclient.tests import utils
15
+from novaclient.tests.v1_1 import fakes
16
+from novaclient.v1_1 import hosts
17 17
 
18 18
 
19 19
 cs = fakes.FakeClient()

+ 1
- 1
novaclient/tests/v1_1/test_images.py View File

@@ -11,9 +11,9 @@
11 11
 #    License for the specific language governing permissions and limitations
12 12
 #    under the License.
13 13
 
14
-from novaclient.v1_1 import images
15 14
 from novaclient.tests import utils
16 15
 from novaclient.tests.v1_1 import fakes
16
+from novaclient.v1_1 import images
17 17
 
18 18
 
19 19
 cs = fakes.FakeClient()

+ 1
- 1
novaclient/tests/v1_1/test_keypairs.py View File

@@ -11,9 +11,9 @@
11 11
 #    License for the specific language governing permissions and limitations
12 12
 #    under the License.
13 13
 
14
-from novaclient.v1_1 import keypairs
15 14
 from novaclient.tests import utils
16 15
 from novaclient.tests.v1_1 import fakes
16
+from novaclient.v1_1 import keypairs
17 17
 
18 18
 
19 19
 cs = fakes.FakeClient()

+ 1
- 1
novaclient/tests/v1_1/test_limits.py View File

@@ -11,9 +11,9 @@
11 11
 #    License for the specific language governing permissions and limitations
12 12
 #    under the License.
13 13
 
14
-from novaclient.v1_1 import limits
15 14
 from novaclient.tests import utils
16 15
 from novaclient.tests.v1_1 import fakes
16
+from novaclient.v1_1 import limits
17 17
 
18 18
 
19 19
 cs = fakes.FakeClient()

+ 1
- 1
novaclient/tests/v1_1/test_networks.py View File

@@ -11,9 +11,9 @@
11 11
 #    License for the specific language governing permissions and limitations
12 12
 #    under the License.
13 13
 
14
-from novaclient.v1_1 import networks
15 14
 from novaclient.tests import utils
16 15
 from novaclient.tests.v1_1 import fakes
16
+from novaclient.v1_1 import networks
17 17
 
18 18
 
19 19
 cs = fakes.FakeClient()

+ 1
- 1
novaclient/tests/v1_1/test_security_group_rules.py View File

@@ -12,9 +12,9 @@
12 12
 #    under the License.
13 13
 
14 14
 from novaclient import exceptions
15
-from novaclient.v1_1 import security_group_rules
16 15
 from novaclient.tests import utils
17 16
 from novaclient.tests.v1_1 import fakes
17
+from novaclient.v1_1 import security_group_rules
18 18
 
19 19
 
20 20
 cs = fakes.FakeClient()

+ 1
- 1
novaclient/tests/v1_1/test_security_groups.py View File

@@ -11,9 +11,9 @@
11 11
 #    License for the specific language governing permissions and limitations
12 12
 #    under the License.
13 13
 
14
-from novaclient.v1_1 import security_groups
15 14
 from novaclient.tests import utils
16 15
 from novaclient.tests.v1_1 import fakes
16
+from novaclient.v1_1 import security_groups
17 17
 
18 18
 
19 19
 cs = fakes.FakeClient()

+ 1
- 1
novaclient/tests/v1_1/test_servers.py View File

@@ -16,9 +16,9 @@ import mock
16 16
 import six
17 17
 
18 18
 from novaclient import exceptions
19
-from novaclient.v1_1 import servers
20 19
 from novaclient.tests import utils
21 20
 from novaclient.tests.v1_1 import fakes
21
+from novaclient.v1_1 import servers
22 22
 
23 23
 
24 24
 cs = fakes.FakeClient()

+ 2
- 2
novaclient/tests/v1_1/test_services.py View File

@@ -15,9 +15,9 @@
15 15
 #    License for the specific language governing permissions and limitations
16 16
 #    under the License.
17 17
 
18
-from novaclient.v1_1 import services
19
-from novaclient.tests.v1_1 import fakes
20 18
 from novaclient.tests import utils
19
+from novaclient.tests.v1_1 import fakes
20
+from novaclient.v1_1 import services
21 21
 
22 22
 
23 23
 cs = fakes.FakeClient()

+ 2
- 2
novaclient/tests/v1_1/test_shell.py View File

@@ -19,17 +19,17 @@
19 19
 import base64
20 20
 import datetime
21 21
 import os
22
-import mock
23 22
 
24 23
 import fixtures
24
+import mock
25 25
 import six
26 26
 
27 27
 import novaclient.client
28 28
 from novaclient import exceptions
29 29
 from novaclient.openstack.common import timeutils
30 30
 import novaclient.shell
31
-from novaclient.tests.v1_1 import fakes
32 31
 from novaclient.tests import utils
32
+from novaclient.tests.v1_1 import fakes
33 33
 import novaclient.v1_1.shell
34 34
 
35 35
 

+ 1
- 1
novaclient/tests/v1_1/test_usage.py View File

@@ -13,9 +13,9 @@
13 13
 
14 14
 import datetime
15 15
 
16
-from novaclient.v1_1 import usage
17 16
 from novaclient.tests import utils
18 17
 from novaclient.tests.v1_1 import fakes
18
+from novaclient.v1_1 import usage
19 19
 
20 20
 
21 21
 cs = fakes.FakeClient()

+ 1
- 1
novaclient/tests/v1_1/test_volumes.py View File

@@ -13,9 +13,9 @@
13 13
 #    License for the specific language governing permissions and limitations
14 14
 #    under the License.
15 15
 
16
-from novaclient.v1_1 import volumes
17 16
 from novaclient.tests import utils
18 17
 from novaclient.tests.v1_1 import fakes
18
+from novaclient.v1_1 import volumes
19 19
 
20 20
 
21 21
 cs = fakes.FakeClient()

+ 1
- 1
novaclient/tests/v3/fakes.py View File

@@ -14,9 +14,9 @@
14 14
 # See the License for the specific language governing permissions and
15 15
 # limitations under the License.
16 16
 
17
-from novaclient.v3 import client
18 17
 from novaclient.tests import fakes
19 18
 from novaclient.tests.v1_1 import fakes as fakes_v1_1
19
+from novaclient.v3 import client
20 20
 
21 21
 
22 22
 class FakeClient(fakes.FakeClient, client.Client):

+ 2
- 2
novaclient/tests/v3/test_hosts.py View File

@@ -12,9 +12,9 @@
12 12
 #    License for the specific language governing permissions and limitations
13 13
 #    under the License.
14 14
 
15
-from novaclient.v3 import hosts
16
-from novaclient.tests.v3 import fakes
17 15
 from novaclient.tests import utils
16
+from novaclient.tests.v3 import fakes
17
+from novaclient.v3 import hosts
18 18
 
19 19
 
20 20
 cs = fakes.FakeClient()

+ 8
- 8
novaclient/v1_1/client.py View File

@@ -16,16 +16,18 @@
16 16
 
17 17
 from novaclient import client
18 18
 from novaclient.v1_1 import agents
19
-from novaclient.v1_1 import certs
20
-from novaclient.v1_1 import cloudpipe
21 19
 from novaclient.v1_1 import aggregates
22 20
 from novaclient.v1_1 import availability_zones
21
+from novaclient.v1_1 import certs
22
+from novaclient.v1_1 import cloudpipe
23 23
 from novaclient.v1_1 import coverage_ext
24
-from novaclient.v1_1 import flavors
24
+from novaclient.v1_1 import fixed_ips
25 25
 from novaclient.v1_1 import flavor_access
26
+from novaclient.v1_1 import flavors
26 27
 from novaclient.v1_1 import floating_ip_dns
27
-from novaclient.v1_1 import floating_ips
28 28
 from novaclient.v1_1 import floating_ip_pools
29
+from novaclient.v1_1 import floating_ips
30
+from novaclient.v1_1 import floating_ips_bulk
29 31
 from novaclient.v1_1 import fping
30 32
 from novaclient.v1_1 import hosts
31 33
 from novaclient.v1_1 import hypervisors
@@ -38,14 +40,12 @@ from novaclient.v1_1 import quotas
38 40
 from novaclient.v1_1 import security_group_rules
39 41
 from novaclient.v1_1 import security_groups
40 42
 from novaclient.v1_1 import servers
43
+from novaclient.v1_1 import services
41 44
 from novaclient.v1_1 import usage
42 45
 from novaclient.v1_1 import virtual_interfaces
43
-from novaclient.v1_1 import volumes
44 46
 from novaclient.v1_1 import volume_snapshots
45 47
 from novaclient.v1_1 import volume_types
46
-from novaclient.v1_1 import services
47
-from novaclient.v1_1 import fixed_ips
48
-from novaclient.v1_1 import floating_ips_bulk
48
+from novaclient.v1_1 import volumes
49 49
 
50 50
 
51 51
 class Client(object):

+ 1
- 1
novaclient/v1_1/flavors.py View File

@@ -17,8 +17,8 @@ Flavor interface.
17 17
 """
18 18
 from novaclient import base
19 19
 from novaclient import exceptions
20
-from novaclient import utils
21 20
 from novaclient.openstack.common.py3kcompat import urlutils
21
+from novaclient import utils
22 22
 
23 23
 
24 24
 class Flavor(base.Resource):

+ 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,H306,H403,H404
31
+ignore = E12,F841,F811,F821,H302,H403,H404
32 32
 show-source = True
33 33
 exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build

Loading…
Cancel
Save