Browse Source

Enable check for E122

E122 continuation line missing indentation or outdented

Change-Id: Ic54714142b3c5aded42d544f296b0ef9a840c282
Andrey Kurilin 4 years ago
parent
commit
d05ae5dcc0

+ 38
- 34
novaclient/tests/fixture_data/servers.py View File

@@ -49,14 +49,15 @@ class Base(base.Fixture):
49 49
             "status": "BUILD",
50 50
             "progress": 60,
51 51
             "addresses": {
52
-                "public": [{
53
-                    "version": 4,
54
-                    "addr": "1.2.3.4",
55
-                },
56
-                {
57
-                    "version": 4,
58
-                    "addr": "5.6.7.8",
59
-                }],
52
+                "public": [
53
+                    {
54
+                        "version": 4,
55
+                        "addr": "1.2.3.4",
56
+                    },
57
+                    {
58
+                        "version": 4,
59
+                        "addr": "5.6.7.8",
60
+                    }],
60 61
                 "private": [{
61 62
                     "version": 4,
62 63
                     "addr": "10.11.12.13",
@@ -89,14 +90,15 @@ class Base(base.Fixture):
89 90
             "hostId": "9e107d9d372bb6826bd81d3542a419d6",
90 91
             "status": "ACTIVE",
91 92
             "addresses": {
92
-                "public": [{
93
-                    "version": 4,
94
-                    "addr": "4.5.6.7",
95
-                },
96
-                {
97
-                    "version": 4,
98
-                    "addr": "5.6.9.8",
99
-                }],
93
+                "public": [
94
+                    {
95
+                        "version": 4,
96
+                        "addr": "4.5.6.7",
97
+                    },
98
+                    {
99
+                        "version": 4,
100
+                        "addr": "5.6.9.8",
101
+                    }],
100 102
                 "private": [{
101 103
                     "version": 4,
102 104
                     "addr": "10.13.12.13",
@@ -106,16 +108,17 @@ class Base(base.Fixture):
106 108
                 "Server Label": "DB 1"
107 109
             },
108 110
             "OS-EXT-SRV-ATTR:host": "computenode2",
109
-            "security_groups": [{
110
-                'id': 1, 'name': 'securitygroup1',
111
-                'description': 'FAKE_SECURITY_GROUP',
112
-                'tenant_id': '4ffc664c198e435e9853f2538fbcd7a7'
113
-            },
114
-            {
115
-                'id': 2, 'name': 'securitygroup2',
116
-                'description': 'ANOTHER_FAKE_SECURITY_GROUP',
117
-                'tenant_id': '4ffc664c198e435e9853f2538fbcd7a7'
118
-            }],
111
+            "security_groups": [
112
+                {
113
+                    'id': 1, 'name': 'securitygroup1',
114
+                    'description': 'FAKE_SECURITY_GROUP',
115
+                    'tenant_id': '4ffc664c198e435e9853f2538fbcd7a7'
116
+                },
117
+                {
118
+                    'id': 2, 'name': 'securitygroup2',
119
+                    'description': 'ANOTHER_FAKE_SECURITY_GROUP',
120
+                    'tenant_id': '4ffc664c198e435e9853f2538fbcd7a7'
121
+                }],
119 122
         }
120 123
 
121 124
         self.server_9012 = {
@@ -129,14 +132,15 @@ class Base(base.Fixture):
129 132
             "hostId": "9e107d9d372bb6826bd81d3542a419d6",
130 133
             "status": "ACTIVE",
131 134
             "addresses": {
132
-                "public": [{
133
-                    "version": 4,
134
-                    "addr": "4.5.6.7",
135
-                },
136
-                {
137
-                    "version": 4,
138
-                    "addr": "5.6.9.8",
139
-                }],
135
+                "public": [
136
+                    {
137
+                        "version": 4,
138
+                        "addr": "4.5.6.7",
139
+                    },
140
+                    {
141
+                        "version": 4,
142
+                        "addr": "5.6.9.8",
143
+                    }],
140 144
                 "private": [{
141 145
                     "version": 4,
142 146
                     "addr": "10.13.12.13",

+ 68
- 69
novaclient/tests/v1_1/fakes.py View File

@@ -234,8 +234,7 @@ class FakeHTTPClient(base_client.HTTPClient):
234 234
                 "maxPersonality": 5,
235 235
                 "maxPersonalitySize": 10240
236 236
             },
237
-        },
238
-    })
237
+        }})
239 238
 
240 239
     #
241 240
     # Servers
@@ -264,14 +263,15 @@ class FakeHTTPClient(base_client.HTTPClient):
264 263
                 "status": "BUILD",
265 264
                 "progress": 60,
266 265
                 "addresses": {
267
-                    "public": [{
268
-                        "version": 4,
269
-                        "addr": "1.2.3.4",
270
-                    },
271
-                    {
272
-                        "version": 4,
273
-                        "addr": "5.6.7.8",
274
-                    }],
266
+                    "public": [
267
+                        {
268
+                            "version": 4,
269
+                            "addr": "1.2.3.4",
270
+                        },
271
+                        {
272
+                            "version": 4,
273
+                            "addr": "5.6.7.8",
274
+                        }],
275 275
                     "private": [{
276 276
                         "version": 4,
277 277
                         "addr": "10.11.12.13",
@@ -303,14 +303,15 @@ class FakeHTTPClient(base_client.HTTPClient):
303 303
                 "hostId": "9e107d9d372bb6826bd81d3542a419d6",
304 304
                 "status": "ACTIVE",
305 305
                 "addresses": {
306
-                    "public": [{
307
-                        "version": 4,
308
-                        "addr": "4.5.6.7",
309
-                    },
310
-                    {
311
-                        "version": 4,
312
-                        "addr": "5.6.9.8",
313
-                    }],
306
+                    "public": [
307
+                        {
308
+                            "version": 4,
309
+                            "addr": "4.5.6.7",
310
+                        },
311
+                        {
312
+                            "version": 4,
313
+                            "addr": "5.6.9.8",
314
+                        }],
314 315
                     "private": [{
315 316
                         "version": 4,
316 317
                         "addr": "10.13.12.13",
@@ -320,16 +321,17 @@ class FakeHTTPClient(base_client.HTTPClient):
320 321
                     "Server Label": "DB 1"
321 322
                 },
322 323
                 "OS-EXT-SRV-ATTR:host": "computenode2",
323
-                "security_groups": [{
324
-                    'id': 1, 'name': 'securitygroup1',
325
-                    'description': 'FAKE_SECURITY_GROUP',
326
-                    'tenant_id': '4ffc664c198e435e9853f2538fbcd7a7'
327
-                },
328
-                {
329
-                    'id': 2, 'name': 'securitygroup2',
330
-                    'description': 'ANOTHER_FAKE_SECURITY_GROUP',
331
-                    'tenant_id': '4ffc664c198e435e9853f2538fbcd7a7'
332
-                }],
324
+                "security_groups": [
325
+                    {
326
+                        'id': 1, 'name': 'securitygroup1',
327
+                        'description': 'FAKE_SECURITY_GROUP',
328
+                        'tenant_id': '4ffc664c198e435e9853f2538fbcd7a7'
329
+                    },
330
+                    {
331
+                        'id': 2, 'name': 'securitygroup2',
332
+                        'description': 'ANOTHER_FAKE_SECURITY_GROUP',
333
+                        'tenant_id': '4ffc664c198e435e9853f2538fbcd7a7'
334
+                    }],
333 335
             },
334 336
             {
335 337
                 "id": 9012,
@@ -342,14 +344,15 @@ class FakeHTTPClient(base_client.HTTPClient):
342 344
                 "hostId": "9e107d9d372bb6826bd81d3542a419d6",
343 345
                 "status": "ACTIVE",
344 346
                 "addresses": {
345
-                    "public": [{
346
-                        "version": 4,
347
-                        "addr": "4.5.6.7",
348
-                    },
349
-                    {
350
-                        "version": 4,
351
-                        "addr": "5.6.9.8",
352
-                    }],
347
+                    "public": [
348
+                        {
349
+                            "version": 4,
350
+                            "addr": "4.5.6.7",
351
+                        },
352
+                        {
353
+                            "version": 4,
354
+                            "addr": "5.6.9.8",
355
+                        }],
353 356
                     "private": [{
354 357
                         "version": 4,
355 358
                         "addr": "10.13.12.13",
@@ -1827,39 +1830,35 @@ class FakeHTTPClient(base_client.HTTPClient):
1827 1830
                                "hosts": None}]})
1828 1831
 
1829 1832
     def get_os_availability_zone_detail(self, **kw):
1830
-        return (200, {}, {"availabilityZoneInfo": [
1831
-                              {"zoneName": "zone-1",
1832
-                               "zoneState": {"available": True},
1833
-                               "hosts": {
1834
-                                   "fake_host-1": {
1835
-                                       "nova-compute": {"active": True,
1836
-                                           "available": True,
1837
-                                           "updated_at":
1838
-                                   datetime.datetime(
1839
-                                       2012, 12, 26, 14, 45, 25, 0
1840
-                                   )}}}},
1841
-                              {"zoneName": "internal",
1842
-                               "zoneState": {"available": True},
1843
-                               "hosts": {
1844
-                                   "fake_host-1": {
1845
-                                       "nova-sched": {
1846
-                                           "active": True,
1847
-                                           "available": True,
1848
-                                           "updated_at":
1849
-                                   datetime.datetime(
1850
-                                       2012, 12, 26, 14, 45, 25, 0
1851
-                                   )}},
1852
-                                   "fake_host-2": {
1853
-                                       "nova-network": {
1854
-                                           "active": True,
1855
-                                           "available": False,
1856
-                                           "updated_at":
1857
-                                   datetime.datetime(
1858
-                                       2012, 12, 26, 14, 45, 24, 0
1859
-                                   )}}}},
1860
-                              {"zoneName": "zone-2",
1861
-                               "zoneState": {"available": False},
1862
-                               "hosts": None}]})
1833
+        return (200, {}, {
1834
+            "availabilityZoneInfo": [
1835
+                {"zoneName": "zone-1",
1836
+                 "zoneState": {"available": True},
1837
+                 "hosts": {
1838
+                     "fake_host-1": {
1839
+                         "nova-compute": {
1840
+                             "active": True,
1841
+                             "available": True,
1842
+                             "updated_at": datetime.datetime(
1843
+                                 2012, 12, 26, 14, 45, 25, 0)}}}},
1844
+                {"zoneName": "internal",
1845
+                 "zoneState": {"available": True},
1846
+                 "hosts": {
1847
+                     "fake_host-1": {
1848
+                         "nova-sched": {
1849
+                             "active": True,
1850
+                             "available": True,
1851
+                             "updated_at": datetime.datetime(
1852
+                                 2012, 12, 26, 14, 45, 25, 0)}},
1853
+                     "fake_host-2": {
1854
+                         "nova-network": {
1855
+                             "active": True,
1856
+                             "available": False,
1857
+                             "updated_at": datetime.datetime(
1858
+                                 2012, 12, 26, 14, 45, 24, 0)}}}},
1859
+                {"zoneName": "zone-2",
1860
+                 "zoneState": {"available": False},
1861
+                 "hosts": None}]})
1863 1862
 
1864 1863
     def get_servers_1234_os_interface(self, **kw):
1865 1864
         return (200, {}, {"interfaceAttachments": [

+ 30
- 33
novaclient/tests/v3/fakes.py View File

@@ -272,39 +272,36 @@ class FakeHTTPClient(fakes_v1_1.FakeHTTPClient):
272 272
                                "hosts": None}]})
273 273
 
274 274
     def get_os_availability_zone_detail(self, **kw):
275
-        return (200, {}, {"availability_zone_info": [
276
-                              {"zone_name": "zone-1",
277
-                               "zone_state": {"available": True},
278
-                               "hosts": {
279
-                                   "fake_host-1": {
280
-                                       "nova-compute": {"active": True,
281
-                                           "available": True,
282
-                                           "updated_at":
283
-                                   datetime.datetime(
284
-                                       2012, 12, 26, 14, 45, 25, 0
285
-                                   )}}}},
286
-                              {"zone_name": "internal",
287
-                               "zone_state": {"available": True},
288
-                               "hosts": {
289
-                                   "fake_host-1": {
290
-                                       "nova-sched": {
291
-                                           "active": True,
292
-                                           "available": True,
293
-                                           "updated_at":
294
-                                   datetime.datetime(
295
-                                       2012, 12, 26, 14, 45, 25, 0
296
-                                   )}},
297
-                                   "fake_host-2": {
298
-                                       "nova-network": {
299
-                                           "active": True,
300
-                                           "available": False,
301
-                                           "updated_at":
302
-                                   datetime.datetime(
303
-                                       2012, 12, 26, 14, 45, 24, 0
304
-                                   )}}}},
305
-                              {"zone_name": "zone-2",
306
-                               "zone_state": {"available": False},
307
-                               "hosts": None}]})
275
+        return (200, {}, {
276
+            "availability_zone_info": [
277
+                {"zone_name": "zone-1",
278
+                 "zone_state": {"available": True},
279
+                 "hosts": {
280
+                     "fake_host-1": {
281
+                         "nova-compute": {
282
+                             "active": True,
283
+                             "available": True,
284
+                             "updated_at": datetime.datetime(
285
+                                 2012, 12, 26, 14, 45, 25, 0)}}}},
286
+                {"zone_name": "internal",
287
+                 "zone_state": {
288
+                     "available": True},
289
+                 "hosts": {
290
+                     "fake_host-1": {
291
+                         "nova-sched": {
292
+                             "active": True,
293
+                             "available": True,
294
+                             "updated_at": datetime.datetime(
295
+                                 2012, 12, 26, 14, 45, 25, 0)}},
296
+                     "fake_host-2": {
297
+                         "nova-network": {
298
+                             "active": True,
299
+                             "available": False,
300
+                             "updated_at": datetime.datetime(
301
+                                 2012, 12, 26, 14, 45, 24, 0)}}}},
302
+                {"zone_name": "zone-2",
303
+                 "zone_state": {"available": False},
304
+                 "hosts": None}]})
308 305
 
309 306
     #
310 307
     # Quotas

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

@@ -84,8 +84,7 @@ class Flavor(base.Resource):
84 84
         """
85 85
         for k in keys:
86 86
             self.manager._delete(
87
-                         "/flavors/%s/os-extra_specs/%s" % (
88
-                         base.getid(self), k))
87
+                "/flavors/%s/os-extra_specs/%s" % (base.getid(self), k))
89 88
 
90 89
     def delete(self):
91 90
         """

+ 1
- 2
novaclient/v3/flavors.py View File

@@ -73,8 +73,7 @@ class Flavor(base.Resource):
73 73
         """
74 74
         for k in keys:
75 75
             self.manager._delete(
76
-                    "/flavors/%s/flavor-extra-specs/%s" % (
77
-                    base.getid(self), k))
76
+                "/flavors/%s/flavor-extra-specs/%s" % (base.getid(self), k))
78 77
 
79 78
     def delete(self):
80 79
         """

+ 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: E122, E123, E124, E126,
44
+# Additional checks are also ignored on purpose: E123, E124, E126,
45 45
 # E127, E128, E129, F811, F821
46
-ignore = E122,E123,E124,E126,E127,E128,E129,F811,F821,H402,H404,H405,H904
46
+ignore = E123,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