Skip to content

Commit 61b99a1

Browse files
committed
Bump hacking min version to 3.1.0
This has introduced a new version of pycodestyle, which has improved its parser to catch new corner cases and introduced some new tests. Closes-Bug: #1878317 Change-Id: I853cf4dbd7ad6b7903a7f444f5c1da3f0fb21f77
1 parent 382d9b2 commit 61b99a1

File tree

17 files changed

+53
-52
lines changed

17 files changed

+53
-52
lines changed

nova/api/openstack/compute/console_auth_tokens.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@ def show(self, req, id):
7676

7777
@wsgi.Controller.api_version("2.31") # noqa
7878
@wsgi.expected_errors((400, 404))
79-
def show(self, req, id):
79+
def show(self, req, id): # noqa
8080
return self._show(req, id, False)

nova/api/openstack/compute/hypervisors.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,13 @@ def index(self, req):
210210
@wsgi.Controller.api_version("2.33", "2.52") # noqa
211211
@validation.query_schema(hyper_schema.list_query_schema_v233)
212212
@wsgi.expected_errors(400)
213-
def index(self, req):
213+
def index(self, req): # noqa
214214
limit, marker = common.get_limit_and_marker(req)
215215
return self._index(req, limit=limit, marker=marker, links=True)
216216

217217
@wsgi.Controller.api_version("2.1", "2.32") # noqa
218218
@wsgi.expected_errors(())
219-
def index(self, req):
219+
def index(self, req): # noqa
220220
return self._index(req)
221221

222222
def _index(self, req, limit=None, marker=None, links=False):
@@ -242,13 +242,13 @@ def detail(self, req):
242242
@wsgi.Controller.api_version("2.33", "2.52") # noqa
243243
@validation.query_schema(hyper_schema.list_query_schema_v233)
244244
@wsgi.expected_errors((400))
245-
def detail(self, req):
245+
def detail(self, req): # noqa
246246
limit, marker = common.get_limit_and_marker(req)
247247
return self._detail(req, limit=limit, marker=marker, links=True)
248248

249249
@wsgi.Controller.api_version("2.1", "2.32") # noqa
250250
@wsgi.expected_errors(())
251-
def detail(self, req):
251+
def detail(self, req): # noqa
252252
return self._detail(req)
253253

254254
def _detail(self, req, limit=None, marker=None, links=False):
@@ -300,7 +300,7 @@ def show(self, req, id):
300300

301301
@wsgi.Controller.api_version("2.1", "2.52") # noqa F811
302302
@wsgi.expected_errors(404)
303-
def show(self, req, id):
303+
def show(self, req, id): # noqa
304304
return self._show(req, id)
305305

306306
def _show(self, req, id, with_servers=False):

nova/api/openstack/compute/instance_actions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def _get_instance(self, req, context, server_id):
7777
return common.get_instance(self.compute_api, context, server_id)
7878

7979
@wsgi.Controller.api_version("2.21") # noqa
80-
def _get_instance(self, req, context, server_id):
80+
def _get_instance(self, req, context, server_id): # noqa
8181
with utils.temporary_mutation(context, read_deleted='yes'):
8282
return common.get_instance(self.compute_api, context, server_id)
8383

@@ -100,7 +100,7 @@ def index(self, req, server_id):
100100
"2.66")
101101
@validation.query_schema(schema_instance_actions.list_query_params_v258,
102102
"2.58", "2.65")
103-
def index(self, req, server_id):
103+
def index(self, req, server_id): # noqa
104104
"""Returns the list of actions recorded for a given instance."""
105105
context = req.environ["nova.context"]
106106
instance = self._get_instance(req, context, server_id)

nova/api/openstack/compute/keypairs.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def create(self, req, body):
6464
@wsgi.response(201)
6565
@wsgi.expected_errors((400, 403, 409))
6666
@validation.schema(keypairs.create_v22)
67-
def create(self, req, body):
67+
def create(self, req, body): # noqa
6868
"""Create or import keypair.
6969
7070
Sending name will generate a key and return private_key
@@ -85,7 +85,7 @@ def create(self, req, body):
8585
@wsgi.expected_errors((400, 403, 409))
8686
@validation.schema(keypairs.create_v20, "2.0", "2.0")
8787
@validation.schema(keypairs.create, "2.1", "2.1")
88-
def create(self, req, body):
88+
def create(self, req, body): # noqa
8989
"""Create or import keypair.
9090
9191
Sending name will generate a key and return private_key
@@ -142,15 +142,15 @@ def delete(self, req, id):
142142
@validation.query_schema(keypairs.delete_query_schema_v20)
143143
@wsgi.response(204)
144144
@wsgi.expected_errors(404)
145-
def delete(self, req, id):
145+
def delete(self, req, id): # noqa
146146
self._delete(req, id)
147147

148148
@wsgi.Controller.api_version("2.10") # noqa
149149
@validation.query_schema(keypairs.delete_query_schema_v275, '2.75')
150150
@validation.query_schema(keypairs.delete_query_schema_v210, '2.10', '2.74')
151151
@wsgi.response(204)
152152
@wsgi.expected_errors(404)
153-
def delete(self, req, id):
153+
def delete(self, req, id): # noqa
154154
# handle optional user-id for admin only
155155
user_id = self._get_user_id(req)
156156
self._delete(req, id, user_id=user_id)
@@ -184,13 +184,13 @@ def show(self, req, id):
184184
@wsgi.Controller.api_version("2.2", "2.9") # noqa
185185
@validation.query_schema(keypairs.show_query_schema_v20)
186186
@wsgi.expected_errors(404)
187-
def show(self, req, id):
187+
def show(self, req, id): # noqa
188188
return self._show(req, id, key_type=True)
189189

190190
@wsgi.Controller.api_version("2.1", "2.1") # noqa
191191
@validation.query_schema(keypairs.show_query_schema_v20)
192192
@wsgi.expected_errors(404)
193-
def show(self, req, id):
193+
def show(self, req, id): # noqa
194194
return self._show(req, id)
195195

196196
def _show(self, req, id, key_type=False, user_id=None):
@@ -217,21 +217,21 @@ def index(self, req):
217217
@wsgi.Controller.api_version("2.10", "2.34") # noqa
218218
@validation.query_schema(keypairs.index_query_schema_v210)
219219
@wsgi.expected_errors(())
220-
def index(self, req):
220+
def index(self, req): # noqa
221221
# handle optional user-id for admin only
222222
user_id = self._get_user_id(req)
223223
return self._index(req, key_type=True, user_id=user_id)
224224

225225
@wsgi.Controller.api_version("2.2", "2.9") # noqa
226226
@validation.query_schema(keypairs.index_query_schema_v20)
227227
@wsgi.expected_errors(())
228-
def index(self, req):
228+
def index(self, req): # noqa
229229
return self._index(req, key_type=True)
230230

231231
@wsgi.Controller.api_version("2.1", "2.1") # noqa
232232
@validation.query_schema(keypairs.index_query_schema_v20)
233233
@wsgi.expected_errors(())
234-
def index(self, req):
234+
def index(self, req): # noqa
235235
return self._index(req)
236236

237237
def _index(self, req, key_type=False, user_id=None, links=False):

nova/api/openstack/compute/limits.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,24 @@ def index(self, req):
5151
return self._index(req)
5252

5353
@wsgi.Controller.api_version(MIN_WITHOUT_PROXY_API_SUPPORT_VERSION, # noqa
54-
MAX_IMAGE_META_PROXY_API_VERSION) # noqa
54+
MAX_IMAGE_META_PROXY_API_VERSION)
5555
@wsgi.expected_errors(())
5656
@validation.query_schema(limits.limits_query_schema)
57-
def index(self, req):
57+
def index(self, req): # noqa
5858
return self._index(req, FILTERED_LIMITS_2_36)
5959

6060
@wsgi.Controller.api_version( # noqa
61-
MIN_WITHOUT_IMAGE_META_PROXY_API_VERSION, '2.56') # noqa
61+
MIN_WITHOUT_IMAGE_META_PROXY_API_VERSION, '2.56')
6262
@wsgi.expected_errors(())
6363
@validation.query_schema(limits.limits_query_schema)
64-
def index(self, req):
64+
def index(self, req): # noqa
6565
return self._index(req, FILTERED_LIMITS_2_36, max_image_meta=False)
6666

6767
@wsgi.Controller.api_version('2.57') # noqa
6868
@wsgi.expected_errors(())
6969
@validation.query_schema(limits.limits_query_schema_275, '2.75')
7070
@validation.query_schema(limits.limits_query_schema, '2.57', '2.74')
71-
def index(self, req):
71+
def index(self, req): # noqa
7272
return self._index(req, FILTERED_LIMITS_2_57, max_image_meta=False)
7373

7474
def _index(self, req, filtered_limits=None, max_image_meta=True):

nova/api/openstack/compute/migrations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,15 @@ def index(self, req):
153153
@wsgi.expected_errors(())
154154
@validation.query_schema(schema_migrations.list_query_schema_v20,
155155
"2.23", "2.58")
156-
def index(self, req):
156+
def index(self, req): # noqa
157157
"""Return all migrations using the query parameters as filters."""
158158
return self._index(req, add_link=True)
159159

160160
@wsgi.Controller.api_version("2.59", "2.65") # noqa
161161
@wsgi.expected_errors(400)
162162
@validation.query_schema(schema_migrations.list_query_params_v259,
163163
"2.59", "2.65")
164-
def index(self, req):
164+
def index(self, req): # noqa
165165
"""Return all migrations using the query parameters as filters."""
166166
limit, marker = common.get_limit_and_marker(req)
167167
return self._index(req, add_link=True, next_link=True, add_uuid=True,
@@ -176,7 +176,7 @@ def index(self, req):
176176
"2.66", "2.79")
177177
@validation.query_schema(schema_migrations.list_query_params_v280,
178178
"2.80")
179-
def index(self, req):
179+
def index(self, req): # noqa
180180
"""Return all migrations using the query parameters as filters."""
181181
limit, marker = common.get_limit_and_marker(req)
182182
return self._index(req, add_link=True, next_link=True, add_uuid=True,

nova/api/openstack/compute/quota_classes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ def show(self, req, id):
8282

8383
@wsgi.Controller.api_version('2.50', '2.56') # noqa
8484
@wsgi.expected_errors(())
85-
def show(self, req, id):
85+
def show(self, req, id): # noqa
8686
return self._show(req, id, FILTERED_QUOTAS_2_50)
8787

8888
@wsgi.Controller.api_version('2.57') # noqa
8989
@wsgi.expected_errors(())
90-
def show(self, req, id):
90+
def show(self, req, id): # noqa
9191
return self._show(req, id, FILTERED_QUOTAS_2_57)
9292

9393
def _show(self, req, id, filtered_quotas=None,
@@ -107,13 +107,13 @@ def update(self, req, id, body):
107107
@wsgi.Controller.api_version("2.50", "2.56") # noqa
108108
@wsgi.expected_errors(400)
109109
@validation.schema(quota_classes.update_v250)
110-
def update(self, req, id, body):
110+
def update(self, req, id, body): # noqa
111111
return self._update(req, id, body, FILTERED_QUOTAS_2_50)
112112

113113
@wsgi.Controller.api_version("2.57") # noqa
114114
@wsgi.expected_errors(400)
115115
@validation.schema(quota_classes.update_v257)
116-
def update(self, req, id, body):
116+
def update(self, req, id, body): # noqa
117117
return self._update(req, id, body, FILTERED_QUOTAS_2_57)
118118

119119
def _update(self, req, id, body, filtered_quotas=None,

nova/api/openstack/compute/quota_sets.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ def show(self, req, id):
112112
@wsgi.Controller.api_version( # noqa
113113
MIN_WITHOUT_PROXY_API_SUPPORT_VERSION, '2.56')
114114
@wsgi.expected_errors(400)
115-
def show(self, req, id):
115+
def show(self, req, id): # noqa
116116
return self._show(req, id, FILTERED_QUOTAS_2_36)
117117

118118
@wsgi.Controller.api_version('2.57') # noqa
119119
@wsgi.expected_errors(400)
120-
def show(self, req, id):
120+
def show(self, req, id): # noqa
121121
return self._show(req, id, FILTERED_QUOTAS_2_57)
122122

123123
@validation.query_schema(quota_sets.query_schema_275, '2.75')
@@ -141,12 +141,12 @@ def detail(self, req, id):
141141
@wsgi.Controller.api_version( # noqa
142142
MIN_WITHOUT_PROXY_API_SUPPORT_VERSION, '2.56')
143143
@wsgi.expected_errors(400)
144-
def detail(self, req, id):
144+
def detail(self, req, id): # noqa
145145
return self._detail(req, id, FILTERED_QUOTAS_2_36)
146146

147147
@wsgi.Controller.api_version('2.57') # noqa
148148
@wsgi.expected_errors(400)
149-
def detail(self, req, id):
149+
def detail(self, req, id): # noqa
150150
return self._detail(req, id, FILTERED_QUOTAS_2_57)
151151

152152
@validation.query_schema(quota_sets.query_schema_275, '2.75')
@@ -172,13 +172,13 @@ def update(self, req, id, body):
172172
MIN_WITHOUT_PROXY_API_SUPPORT_VERSION, '2.56')
173173
@wsgi.expected_errors(400)
174174
@validation.schema(quota_sets.update_v236)
175-
def update(self, req, id, body):
175+
def update(self, req, id, body): # noqa
176176
return self._update(req, id, body, FILTERED_QUOTAS_2_36)
177177

178178
@wsgi.Controller.api_version('2.57') # noqa
179179
@wsgi.expected_errors(400)
180180
@validation.schema(quota_sets.update_v257)
181-
def update(self, req, id, body):
181+
def update(self, req, id, body): # noqa
182182
return self._update(req, id, body, FILTERED_QUOTAS_2_57)
183183

184184
@validation.query_schema(quota_sets.query_schema_275, '2.75')
@@ -247,12 +247,12 @@ def defaults(self, req, id):
247247
@wsgi.Controller.api_version( # noqa
248248
MIN_WITHOUT_PROXY_API_SUPPORT_VERSION, '2.56')
249249
@wsgi.expected_errors(400)
250-
def defaults(self, req, id):
250+
def defaults(self, req, id): # noqa
251251
return self._defaults(req, id, FILTERED_QUOTAS_2_36)
252252

253253
@wsgi.Controller.api_version('2.57') # noqa
254254
@wsgi.expected_errors(400)
255-
def defaults(self, req, id):
255+
def defaults(self, req, id): # noqa
256256
return self._defaults(req, id, FILTERED_QUOTAS_2_57)
257257

258258
def _defaults(self, req, id, filtered_quotas):

nova/api/openstack/compute/servers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ def _add_location(robj):
101101
if 'server' not in robj.obj:
102102
return robj
103103

104-
link = [l for l in robj.obj['server']['links'] if l['rel'] == 'self']
104+
link = [link for link in robj.obj['server'][
105+
'links'] if link['rel'] == 'self']
105106
if link:
106107
robj['Location'] = link[0]['href']
107108

nova/api/openstack/compute/services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def update(self, req, id, body):
380380
@wsgi.Controller.api_version(UUID_FOR_ID_MIN_VERSION) # noqa F811
381381
@wsgi.expected_errors((400, 404))
382382
@validation.schema(services.service_update_v2_53, UUID_FOR_ID_MIN_VERSION)
383-
def update(self, req, id, body):
383+
def update(self, req, id, body): # noqa
384384
"""Perform service update
385385
386386
Starting with microversion 2.53, the service uuid is passed in on the

nova/api/openstack/compute/simple_tenant_usage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def index(self, req):
273273
@wsgi.Controller.api_version("2.1", "2.39") # noqa
274274
@validation.query_schema(schema.index_query)
275275
@wsgi.expected_errors(400)
276-
def index(self, req):
276+
def index(self, req): # noqa
277277
"""Retrieve tenant_usage for all tenants."""
278278
return self._index(req)
279279

@@ -288,7 +288,7 @@ def show(self, req, id):
288288
@wsgi.Controller.api_version("2.1", "2.39") # noqa
289289
@validation.query_schema(schema.show_query)
290290
@wsgi.expected_errors(400)
291-
def show(self, req, id):
291+
def show(self, req, id): # noqa
292292
"""Retrieve tenant_usage for a specified tenant."""
293293
return self._show(req, id)
294294

nova/db/sqlalchemy/migrate_repo/versions/330_enforce_mitaka_online_migrations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def upgrade(migrate_engine):
2929
for table in (compute_nodes, aggregates):
3030
count = select([func.count()]).select_from(table).where(and_(
3131
table.c.deleted == 0,
32-
table.c.uuid == None)).execute().scalar() # NOQA
32+
table.c.uuid == None)).execute().scalar() # noqa
3333
if count > 0:
3434
msg = WARNING_MSG % {
3535
'count': count,
@@ -45,8 +45,8 @@ def upgrade(migrate_engine):
4545
# if the definition is altered.
4646
count = select([func.count()]).select_from(pci_devices).where(and_(
4747
pci_devices.c.deleted == 0,
48-
pci_devices.c.parent_addr == None,
49-
pci_devices.c.dev_type == 'type-VF')).execute().scalar() # NOQA
48+
pci_devices.c.parent_addr == None, # noqa
49+
pci_devices.c.dev_type == 'type-VF')).execute().scalar()
5050
if count > 0:
5151
msg = WARNING_MSG % {
5252
'count': count,

nova/tests/unit/api/openstack/compute/microversions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ def index(self, req):
3131
return data
3232

3333
@wsgi.Controller.api_version("2.2") # noqa
34-
def index(self, req):
34+
def index(self, req): # noqa
3535
data = {'param': 'val2'}
3636
return data
3737

3838
@wsgi.Controller.api_version("3.0") # noqa
39-
def index(self, req):
39+
def index(self, req): # noqa
4040
raise webob.exc.HTTPBadRequest()
4141

4242

@@ -52,7 +52,7 @@ def index(self, req):
5252

5353
@wsgi.Controller.api_version("2.5", "3.1") # noqa
5454
@wsgi.response(202)
55-
def index(self, req):
55+
def index(self, req): # noqa
5656
data = {'param': 'controller2_val2'}
5757
return data
5858

@@ -88,7 +88,7 @@ def _create(self, req):
8888
return data
8989

9090
@wsgi.Controller.api_version("2.2") # noqa
91-
def _create(self, req):
91+
def _create(self, req): # noqa
9292
data = {'param': 'controller4_val2'}
9393
return data
9494

nova/tests/unit/compute/test_compute_mgr.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6261,6 +6261,7 @@ def test_spawn_called_with_accel_info(self, mock_ins_usage,
62616261
mock_get_allocations, mock_ins_save, mock_spawn):
62626262

62636263
accel_info = [{'k1': 'v1', 'k2': 'v2'}]
6264+
62646265
@contextlib.contextmanager
62656266
def fake_build_resources(compute_mgr, *args, **kwargs):
62666267
yield {

nova/tests/unit/objects/test_objects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ class Parent(base.NovaObject):
881881
}
882882

883883
@base.NovaObjectRegistry.register # noqa
884-
class Parent(base.NovaObject):
884+
class Parent(base.NovaObject): # noqa
885885
VERSION = '1.1'
886886

887887
fields = {

0 commit comments

Comments
 (0)