Browse Source

Enable check for E123

E123 closing bracket does not match indentation of opening bracket's line

Change-Id: I3f941032efb5ca2ef9a78f865effbf79c8674ebb
tags/2.21.0
Andrey Kurilin 4 years ago
parent
commit
8b8aa499e1

+ 1
- 1
novaclient/tests/fixture_data/servers.py View File

@@ -562,7 +562,7 @@ class V3(Base):
562 562
             'rescue': {'admin_password': 'RescuePassword'},
563 563
             'get_console_output': {'output': 'foo'},
564 564
             'rebuild': {'server': self.server_1234},
565
-            }
565
+        }
566 566
         body_param_check_exists = {
567 567
             'rebuild': 'image_ref',
568 568
             'resize': 'flavor_ref'}

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

@@ -91,7 +91,7 @@ class ClientTest(utils.TestCase):
91 91
                     "passwordCredentials": {
92 92
                         "username": "user",
93 93
                         "password": "password"
94
-                        }
94
+                    }
95 95
                 }
96 96
             }
97 97
 

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

@@ -22,7 +22,7 @@ from novaclient.v1_1.contrib import baremetal
22 22
 
23 23
 extensions = [
24 24
     extension.Extension(baremetal.__name__.split(".")[-1], baremetal),
25
-    ]
25
+]
26 26
 cs = fakes.FakeClient(extensions=extensions)
27 27
 
28 28
 

+ 10
- 16
novaclient/tests/v1_1/fakes.py View File

@@ -1285,8 +1285,7 @@ class FakeHTTPClient(base_client.HTTPClient):
1285 1285
              "tenant_id": "272bee4c1e624cd4a72a6b0ea55b4582",
1286 1286
              "id": 2,
1287 1287
              "rules": []}
1288
-            ]}
1289
-        )
1288
+        ]})
1290 1289
 
1291 1290
     def get_os_security_groups_1(self, **kw):
1292 1291
         return (200, {}, {"security_group":
@@ -1649,8 +1648,7 @@ class FakeHTTPClient(base_client.HTTPClient):
1649 1648
     def get_os_hypervisors(self, **kw):
1650 1649
         return (200, {}, {"hypervisors": [
1651 1650
                     {'id': 1234, 'hypervisor_hostname': 'hyper1'},
1652
-                    {'id': 5678, 'hypervisor_hostname': 'hyper2'},
1653
-                    ]})
1651
+                    {'id': 5678, 'hypervisor_hostname': 'hyper2'}]})
1654 1652
 
1655 1653
     def get_os_hypervisors_detail(self, **kw):
1656 1654
         return (200, {}, {"hypervisors": [
@@ -1688,7 +1686,7 @@ class FakeHTTPClient(base_client.HTTPClient):
1688 1686
                      'running_vms': 2,
1689 1687
                      'cpu_info': 'cpu_info',
1690 1688
                      'disk_available_least': 100}
1691
-                    ]})
1689
+        ]})
1692 1690
 
1693 1691
     def get_os_hypervisors_statistics(self, **kw):
1694 1692
         return (200, {}, {"hypervisor_statistics": {
@@ -1704,13 +1702,12 @@ class FakeHTTPClient(base_client.HTTPClient):
1704 1702
                     'current_workload': 4,
1705 1703
                     'running_vms': 4,
1706 1704
                     'disk_available_least': 200,
1707
-                    }})
1705
+        }})
1708 1706
 
1709 1707
     def get_os_hypervisors_hyper_search(self, **kw):
1710 1708
         return (200, {}, {'hypervisors': [
1711 1709
                     {'id': 1234, 'hypervisor_hostname': 'hyper1'},
1712
-                    {'id': 5678, 'hypervisor_hostname': 'hyper2'}
1713
-                    ]})
1710
+                    {'id': 5678, 'hypervisor_hostname': 'hyper2'}]})
1714 1711
 
1715 1712
     def get_os_hypervisors_hyper_servers(self, **kw):
1716 1713
         return (200, {}, {'hypervisors': [
@@ -1718,15 +1715,13 @@ class FakeHTTPClient(base_client.HTTPClient):
1718 1715
                      'hypervisor_hostname': 'hyper1',
1719 1716
                      'servers': [
1720 1717
                             {'name': 'inst1', 'uuid': 'uuid1'},
1721
-                            {'name': 'inst2', 'uuid': 'uuid2'}
1722
-                            ]},
1718
+                            {'name': 'inst2', 'uuid': 'uuid2'}]},
1723 1719
                     {'id': 5678,
1724 1720
                      'hypervisor_hostname': 'hyper2',
1725 1721
                      'servers': [
1726 1722
                             {'name': 'inst3', 'uuid': 'uuid3'},
1727
-                            {'name': 'inst4', 'uuid': 'uuid4'}
1728
-                            ]}
1729
-                    ]})
1723
+                            {'name': 'inst4', 'uuid': 'uuid4'}]}
1724
+        ]})
1730 1725
 
1731 1726
     def get_os_hypervisors_hyper_no_servers_servers(self, **kw):
1732 1727
         return (200, {}, {'hypervisors':
@@ -2051,12 +2046,11 @@ class FakeHTTPClient(base_client.HTTPClient):
2051 2046
                         'rpc_host': '10.0.1.10',
2052 2047
                         'type': 'child',
2053 2048
                         'name': 'cell1',
2054
-                        'rpc_port': 5673
2055
-                        },
2049
+                        'rpc_port': 5673},
2056 2050
                     'type': 'child',
2057 2051
                     'rpc_port': 5673,
2058 2052
                     'loaded': True
2059
-                }}
2053
+        }}
2060 2054
         return (200, {}, cell)
2061 2055
 
2062 2056
     def get_os_cells_capacities(self, **kw):

+ 4
- 6
novaclient/tests/v1_1/test_hypervisors.py View File

@@ -30,8 +30,7 @@ class HypervisorsTest(utils.FixturedTestCase):
30 30
     def test_hypervisor_index(self):
31 31
         expected = [
32 32
             dict(id=1234, hypervisor_hostname='hyper1'),
33
-            dict(id=5678, hypervisor_hostname='hyper2'),
34
-            ]
33
+            dict(id=5678, hypervisor_hostname='hyper2')]
35 34
 
36 35
         result = self.cs.hypervisors.list(False)
37 36
         self.assert_called('GET', '/os-hypervisors')
@@ -85,8 +84,7 @@ class HypervisorsTest(utils.FixturedTestCase):
85 84
     def test_hypervisor_search(self):
86 85
         expected = [
87 86
             dict(id=1234, hypervisor_hostname='hyper1'),
88
-            dict(id=5678, hypervisor_hostname='hyper2'),
89
-            ]
87
+            dict(id=5678, hypervisor_hostname='hyper2')]
90 88
 
91 89
         result = self.cs.hypervisors.search('hyper')
92 90
         self.assert_called('GET', '/os-hypervisors/hyper/search')
@@ -106,7 +104,7 @@ class HypervisorsTest(utils.FixturedTestCase):
106 104
                  servers=[
107 105
                      dict(name='inst3', uuid='uuid3'),
108 106
                      dict(name='inst4', uuid='uuid4')]),
109
-            ]
107
+        ]
110 108
 
111 109
         result = self.cs.hypervisors.search('hyper', True)
112 110
         self.assert_called('GET', '/os-hypervisors/hyper/servers')
@@ -164,7 +162,7 @@ class HypervisorsTest(utils.FixturedTestCase):
164 162
             current_workload=4,
165 163
             running_vms=4,
166 164
             disk_available_least=200,
167
-            )
165
+        )
168 166
 
169 167
         result = self.cs.hypervisors.statistics()
170 168
         self.assert_called('GET', '/os-hypervisors/statistics')

+ 5
- 4
novaclient/tests/v1_1/test_servers.py View File

@@ -640,11 +640,12 @@ class ServersTest(utils.FixturedTestCase):
640 640
             'port_id': 'f35079da-36d5-4513-8ec1-0298d703f70e',
641 641
             'mac_addr': 'fa:16:3e:4c:37:c8',
642 642
             'port_state': 'ACTIVE',
643
-            'fixed_ips': [{
644
-                'subnet_id': 'f1ad93ad-2967-46ba-b403-e8cbbe65f7fa',
645
-                'ip_address': '10.2.0.96'
643
+            'fixed_ips': [
644
+                {
645
+                    'subnet_id': 'f1ad93ad-2967-46ba-b403-e8cbbe65f7fa',
646
+                    'ip_address': '10.2.0.96'
646 647
                 }]
647
-            }]
648
+        }]
648 649
         # If server is not string representable, it will raise an exception,
649 650
         # because attribute named 'name' cannot be found.
650 651
         # Parameter 'loaded' must be True or it will try to get attribute

+ 4
- 8
novaclient/tests/v3/fakes.py View File

@@ -195,7 +195,7 @@ class FakeHTTPClient(fakes_v1_1.FakeHTTPClient):
195 195
             'rescue': {'admin_password': 'RescuePassword'},
196 196
             'get_console_output': {'output': 'foo'},
197 197
             'rebuild': self.get_servers_1234()[2],
198
-            }
198
+        }
199 199
         body_param_check_exists = {
200 200
             'rebuild': 'image_ref',
201 201
             'resize': 'flavor_ref',
@@ -336,12 +336,10 @@ class FakeHTTPClient(fakes_v1_1.FakeHTTPClient):
336 336
     def get_os_hypervisors_search(self, **kw):
337 337
         if kw['query'] == 'hyper1':
338 338
             return (200, {}, {'hypervisors': [
339
-                        {'id': 1234, 'hypervisor_hostname': 'hyper1'},
340
-                        ]})
339
+                {'id': 1234, 'hypervisor_hostname': 'hyper1'}]})
341 340
         return (200, {}, {'hypervisors': [
342 341
                     {'id': 1234, 'hypervisor_hostname': 'hyper1'},
343
-                    {'id': 5678, 'hypervisor_hostname': 'hyper2'}
344
-                    ]})
342
+                    {'id': 5678, 'hypervisor_hostname': 'hyper2'}]})
345 343
 
346 344
     def get_os_hypervisors_1234_servers(self, **kw):
347 345
         return (200, {}, {'hypervisor':
@@ -349,9 +347,7 @@ class FakeHTTPClient(fakes_v1_1.FakeHTTPClient):
349 347
                      'hypervisor_hostname': 'hyper1',
350 348
                      'servers': [
351 349
                             {'name': 'inst1', 'id': 'uuid1'},
352
-                            {'name': 'inst2', 'id': 'uuid2'}
353
-                            ]},
354
-                    })
350
+                            {'name': 'inst2', 'id': 'uuid2'}]}})
355 351
 
356 352
     #
357 353
     # Keypairs

+ 1
- 2
novaclient/tests/v3/test_hypervisors.py View File

@@ -26,8 +26,7 @@ class HypervisorsTest(test_hypervisors.HypervisorsTest):
26 26
     def test_hypervisor_search(self):
27 27
         expected = [
28 28
             dict(id=1234, hypervisor_hostname='hyper1'),
29
-            dict(id=5678, hypervisor_hostname='hyper2'),
30
-            ]
29
+            dict(id=5678, hypervisor_hostname='hyper2')]
31 30
 
32 31
         result = self.cs.hypervisors.search('hyper')
33 32
         self.assert_called('GET', '/os-hypervisors/search?query=hyper')

+ 2
- 2
novaclient/v1_1/contrib/baremetal.py View File

@@ -243,7 +243,7 @@ def _print_baremetal_nodes_list(nodes):
243 243
         'PM Username',
244 244
         'PM Password',
245 245
         'Terminal Port',
246
-        ], formatters=formatters)
246
+    ], formatters=formatters)
247 247
 
248 248
 
249 249
 def do_baremetal_node_list(cs, _args):
@@ -270,7 +270,7 @@ def _print_baremetal_node_interfaces(interfaces):
270 270
         'Datapath_ID',
271 271
         'Port_No',
272 272
         'Address',
273
-        ])
273
+    ])
274 274
 
275 275
 
276 276
 @utils.arg('node',

+ 2
- 2
tox.ini View File

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

Loading…
Cancel
Save