Browse Source

Enable check for E129

E129 visually indented line with same indent as next logical line

Change-Id: I438bf0d9de7f61ab65e753169c9a8007e84b215a
Andrey Kurilin 4 years ago
parent
commit
3065afd6c0

+ 1
- 1
novaclient/client.py View File

@@ -421,7 +421,7 @@ class HTTPClient(object):
421 421
             # or 'actively refused' in the body, so that's what we'll do.
422 422
             if resp.status_code == 400:
423 423
                 if ('Connection refused' in resp.text or
424
-                    'actively refused' in resp.text):
424
+                        'actively refused' in resp.text):
425 425
                     raise exceptions.ConnectionRefused(resp.text)
426 426
             try:
427 427
                 body = json.loads(resp.text)

+ 1
- 1
novaclient/shell.py View File

@@ -135,7 +135,7 @@ class SecretsHelper(object):
135 135
         if not HAS_KEYRING or not self.args.os_cache:
136 136
             return
137 137
         if (auth_token == self.auth_token and
138
-            management_url == self.management_url):
138
+                management_url == self.management_url):
139 139
             # Nothing changed....
140 140
             return
141 141
         if not all([management_url, auth_token, tenant_id]):

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

@@ -200,8 +200,8 @@ class ShellTest(utils.TestCase):
200 200
         # default output of empty tables differs depending between prettytable
201 201
         # versions
202 202
         if (hasattr(prettytable, '__version__') and
203
-            dist_version.StrictVersion(prettytable.__version__) <
204
-            dist_version.StrictVersion('0.7.2')):
203
+                dist_version.StrictVersion(prettytable.__version__) <
204
+                dist_version.StrictVersion('0.7.2')):
205 205
             ex = '\n'
206 206
         else:
207 207
             ex = '\n'.join([

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

@@ -537,7 +537,7 @@ class ServerManager(base.BootingManagerWithFind):
537 537
                 if nic_info.get('net-id'):
538 538
                     net_data['uuid'] = nic_info['net-id']
539 539
                 if (nic_info.get('v4-fixed-ip') and
540
-                    nic_info.get('v6-fixed-ip')):
540
+                        nic_info.get('v6-fixed-ip')):
541 541
                     raise base.exceptions.CommandError(_(
542 542
                         "Only one of 'v4-fixed-ip' and 'v6-fixed-ip' may be"
543 543
                         " provided."))

+ 14
- 13
novaclient/v1_1/shell.py View File

@@ -156,7 +156,8 @@ def _boot(cs, args):
156 156
     max_count = 1
157 157
     # Don't let user mix num_instances and max_count/min_count.
158 158
     if (args.num_instances is not None and
159
-        args.min_count is None and args.max_count is None):
159
+            args.min_count is None and
160
+            args.max_count is None):
160 161
         if args.num_instances < 1:
161 162
             raise exceptions.CommandError(_("num_instances should be >= 1"))
162 163
         max_count = args.num_instances
@@ -173,10 +174,10 @@ def _boot(cs, args):
173 174
         if args.max_count < 1:
174 175
             raise exceptions.CommandError(_("max_count should be >= 1"))
175 176
         max_count = args.max_count
176
-    if (args.min_count is not None and args.max_count is not None and
177
-        args.min_count > args.max_count):
178
-            raise exceptions.CommandError(_(
179
-                "min_count should be <= max_count"))
177
+    if (args.min_count is not None and
178
+            args.max_count is not None and
179
+            args.min_count > args.max_count):
180
+        raise exceptions.CommandError(_("min_count should be <= max_count"))
180 181
 
181 182
     flavor = _find_flavor(cs, args.flavor)
182 183
 
@@ -2435,10 +2436,10 @@ def do_secgroup_delete_rule(cs, args):
2435 2436
     secgroup = _get_secgroup(cs, args.secgroup)
2436 2437
     for rule in secgroup.rules:
2437 2438
         if (rule['ip_protocol'] and
2438
-            rule['ip_protocol'].upper() == args.ip_proto.upper() and
2439
-            rule['from_port'] == int(args.from_port) and
2440
-            rule['to_port'] == int(args.to_port) and
2441
-            rule['ip_range']['cidr'] == args.cidr):
2439
+                rule['ip_protocol'].upper() == args.ip_proto.upper() and
2440
+                rule['from_port'] == int(args.from_port) and
2441
+                rule['to_port'] == int(args.to_port) and
2442
+                rule['ip_range']['cidr'] == args.cidr):
2442 2443
             _print_secgroup_rules([rule])
2443 2444
             return cs.security_group_rules.delete(rule['id'])
2444 2445
 
@@ -3875,10 +3876,10 @@ def do_secgroup_delete_default_rule(cs, args):
3875 3876
     """Delete a rule from the default security group."""
3876 3877
     for rule in cs.security_group_default_rules.list():
3877 3878
         if (rule.ip_protocol and
3878
-            rule.ip_protocol.upper() == args.ip_proto.upper() and
3879
-            rule.from_port == int(args.from_port) and
3880
-            rule.to_port == int(args.to_port) and
3881
-            rule.ip_range['cidr'] == args.cidr):
3879
+                rule.ip_protocol.upper() == args.ip_proto.upper() and
3880
+                rule.from_port == int(args.from_port) and
3881
+                rule.to_port == int(args.to_port) and
3882
+                rule.ip_range['cidr'] == args.cidr):
3882 3883
             _print_secgroup_rules([rule], show_source_group=False)
3883 3884
             return cs.security_group_default_rules.delete(rule.id)
3884 3885
 

+ 1
- 1
novaclient/v3/servers.py View File

@@ -461,7 +461,7 @@ class ServerManager(base.BootingManagerWithFind):
461 461
                 if nic_info.get('net-id'):
462 462
                     net_data['uuid'] = nic_info['net-id']
463 463
                 if (nic_info.get('v4-fixed-ip') and
464
-                    nic_info.get('v6-fixed-ip')):
464
+                        nic_info.get('v6-fixed-ip')):
465 465
                     raise base.exceptions.CommandError(_(
466 466
                         "Only one of 'v4-fixed-ip' and 'v6-fixed-ip' may be"
467 467
                         " provided."))

+ 10
- 9
novaclient/v3/shell.py View File

@@ -88,7 +88,8 @@ def _boot(cs, args):
88 88
     max_count = 1
89 89
     # Don't let user mix num_instances and max_count/min_count.
90 90
     if (args.num_instances is not None and
91
-        args.min_count is None and args.max_count is None):
91
+            args.min_count is None and
92
+            args.max_count is None):
92 93
         if args.num_instances < 1:
93 94
             raise exceptions.CommandError("num_instances should be >= 1")
94 95
         max_count = args.num_instances
@@ -105,10 +106,10 @@ def _boot(cs, args):
105 106
         if args.max_count < 1:
106 107
             raise exceptions.CommandError("max_count should be >= 1")
107 108
         max_count = args.max_count
108
-    if (args.min_count is not None and args.max_count is not None and
109
-        args.min_count > args.max_count):
110
-            raise exceptions.CommandError(
111
-                "min_count should be <= max_count")
109
+    if (args.min_count is not None and
110
+            args.max_count is not None and
111
+            args.min_count > args.max_count):
112
+        raise exceptions.CommandError("min_count should be <= max_count")
112 113
 
113 114
     flavor = _find_flavor(cs, args.flavor)
114 115
 
@@ -1846,10 +1847,10 @@ def do_secgroup_delete_rule(cs, args):
1846 1847
     secgroup = _get_secgroup(cs, args.secgroup)
1847 1848
     for rule in secgroup.rules:
1848 1849
         if (rule['ip_protocol'] and
1849
-            rule['ip_protocol'].upper() == args.ip_proto.upper() and
1850
-            rule['from_port'] == int(args.from_port) and
1851
-            rule['to_port'] == int(args.to_port) and
1852
-            rule['ip_range']['cidr'] == args.cidr):
1850
+                rule['ip_protocol'].upper() == args.ip_proto.upper() and
1851
+                rule['from_port'] == int(args.from_port) and
1852
+                rule['to_port'] == int(args.to_port) and
1853
+                rule['ip_range']['cidr'] == args.cidr):
1853 1854
             _print_secgroup_rules([rule])
1854 1855
             return cs.security_group_rules.delete(rule['id'])
1855 1856
 

+ 1
- 1
tox.ini View File

@@ -42,7 +42,7 @@ downloadcache = ~/cache/pip
42 42
 # reason: removed in hacking (https://review.openstack.org/#/c/101701/)
43 43
 #
44 44
 # Additional checks are also ignored on purpose: F811, F821
45
-ignore = E124,E128,E129,F811,F821,H402,H404,H405,H904
45
+ignore = E124,E128,F811,F821,H402,H404,H405,H904
46 46
 show-source = True
47 47
 exclude=.venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,build,doc/source/conf.py
48 48
 

Loading…
Cancel
Save