Fix 'force' parameter in os-quota-sets PUT schema

A regression was introduced in the 2.36 API microversion where the
'force' parameter was missing from the 'PUT /os-quota-sets/{tenant_id}'
API request schema so users could not force quota updates with
microversion 2.36 or later. The bug is now fixed so that the 'force'
parameter can once again be specified during quota updates. There is
no new microversion for this change since it is an admin-only API.

Change-Id: I947e927802f755ccb25a91efd82cac895779d19e
Closes-Bug: #1733886
(cherry picked from commit 9ddbaa15cb)
(cherry picked from commit 6f5b3123cc)
This commit is contained in:
Matt Riedemann 2017-11-27 13:48:13 -05:00
parent bbfc4230ef
commit 901377b22b
24 changed files with 329 additions and 7 deletions

View File

@ -0,0 +1,15 @@
{
"quota_set": {
"cores": 20,
"id": "fake_tenant",
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
"injected_files": 5,
"instances": 10,
"key_pairs": 100,
"metadata_items": 128,
"ram": 51200,
"server_groups": 10,
"server_group_members": 10
}
}

View File

@ -0,0 +1,55 @@
{
"quota_set": {
"cores": {
"in_use": 0,
"limit": 20,
"reserved": 0
},
"id": "fake_tenant",
"injected_file_content_bytes": {
"in_use": 0,
"limit": 10240,
"reserved": 0
},
"injected_file_path_bytes": {
"in_use": 0,
"limit": 255,
"reserved": 0
},
"injected_files": {
"in_use": 0,
"limit": 5,
"reserved": 0
},
"instances": {
"in_use": 0,
"limit": 10,
"reserved": 0
},
"key_pairs": {
"in_use": 0,
"limit": 100,
"reserved": 0
},
"metadata_items": {
"in_use": 0,
"limit": 128,
"reserved": 0
},
"ram": {
"in_use": 0,
"limit": 51200,
"reserved": 0
},
"server_group_members": {
"in_use": 0,
"limit": 10,
"reserved": 0
},
"server_groups": {
"in_use": 0,
"limit": 10,
"reserved": 0
}
}
}

View File

@ -0,0 +1,15 @@
{
"quota_set": {
"cores": 20,
"id": "fake_tenant",
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
"injected_files": 5,
"instances": 10,
"key_pairs": 100,
"metadata_items": 128,
"ram": 51200,
"server_groups": 10,
"server_group_members": 10
}
}

View File

@ -0,0 +1,6 @@
{
"quota_set": {
"force": "True",
"instances": 45
}
}

View File

@ -1,8 +1,6 @@
{
"quota_set": {
"cores": 20,
"floating_ips": 10,
"fixed_ips": -1,
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
"injected_files": 5,
@ -10,10 +8,7 @@
"key_pairs": 100,
"metadata_items": 128,
"ram": 51200,
"security_group_rules": 20,
"security_groups": 10,
"server_groups": 10,
"server_group_members": 10,
"id": "fake_tenant"
"server_group_members": 10
}
}

View File

@ -0,0 +1,5 @@
{
"quota_set": {
"instances": 45
}
}

View File

@ -0,0 +1,14 @@
{
"quota_set": {
"cores": 20,
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
"injected_files": 5,
"instances": 45,
"key_pairs": 100,
"metadata_items": 128,
"ram": 51200,
"server_groups": 10,
"server_group_members": 10
}
}

View File

@ -0,0 +1,15 @@
{
"quota_set": {
"cores": 20,
"id": "fake_tenant",
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
"injected_files": 5,
"instances": 10,
"key_pairs": 100,
"metadata_items": 128,
"ram": 51200,
"server_groups": 10,
"server_group_members": 10
}
}

View File

@ -0,0 +1,6 @@
{
"quota_set": {
"force": "True",
"instances": 9
}
}

View File

@ -0,0 +1,14 @@
{
"quota_set": {
"cores": 20,
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
"injected_files": 5,
"instances": 9,
"key_pairs": 100,
"metadata_items": 128,
"ram": 51200,
"server_groups": 10,
"server_group_members": 10
}
}

View File

@ -397,6 +397,12 @@ user documentation.
'/os-baremetal-nodes'
'/os-fping'
.. note:: A `regression`_ was introduced in this microversion which broke the
``force`` parameter in the ``PUT /os-quota-sets`` API. The fix will have
to be applied to restore this functionality.
.. _regression: https://bugs.launchpad.net/nova/+bug/1733886
2.37
----

View File

@ -46,7 +46,7 @@ quota_resources = {
update_quota_set = copy.deepcopy(quota_resources)
update_quota_set.update({'force': parameter_types.boolean})
update_quota_set_v236 = copy.deepcopy(quota_resources)
update_quota_set_v236 = copy.deepcopy(update_quota_set)
del update_quota_set_v236['fixed_ips']
del update_quota_set_v236['floating_ips']
del update_quota_set_v236['security_groups']

View File

@ -0,0 +1,15 @@
{
"quota_set": {
"cores": 20,
"id": "fake_tenant",
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
"injected_files": 5,
"instances": 10,
"key_pairs": 100,
"metadata_items": 128,
"ram": 51200,
"server_groups": 10,
"server_group_members": 10
}
}

View File

@ -0,0 +1,55 @@
{
"quota_set": {
"cores": {
"in_use": 0,
"limit": 20,
"reserved": 0
},
"id": "fake_tenant",
"injected_file_content_bytes": {
"in_use": 0,
"limit": 10240,
"reserved": 0
},
"injected_file_path_bytes": {
"in_use": 0,
"limit": 255,
"reserved": 0
},
"injected_files": {
"in_use": 0,
"limit": 5,
"reserved": 0
},
"instances": {
"in_use": 0,
"limit": 10,
"reserved": 0
},
"key_pairs": {
"in_use": 0,
"limit": 100,
"reserved": 0
},
"metadata_items": {
"in_use": 0,
"limit": 128,
"reserved": 0
},
"ram": {
"in_use": 0,
"limit": 51200,
"reserved": 0
},
"server_group_members": {
"in_use": 0,
"limit": 10,
"reserved": 0
},
"server_groups": {
"in_use": 0,
"limit": 10,
"reserved": 0
}
}
}

View File

@ -0,0 +1,15 @@
{
"quota_set": {
"cores": 20,
"id": "fake_tenant",
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
"injected_files": 5,
"instances": 10,
"key_pairs": 100,
"metadata_items": 128,
"ram": 51200,
"server_groups": 10,
"server_group_members": 10
}
}

View File

@ -0,0 +1,6 @@
{
"quota_set": {
"force": "True",
"instances": 45
}
}

View File

@ -0,0 +1,14 @@
{
"quota_set": {
"cores": 20,
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
"injected_files": 5,
"instances": 45,
"key_pairs": 100,
"metadata_items": 128,
"ram": 51200,
"server_groups": 10,
"server_group_members": 10
}
}

View File

@ -0,0 +1,5 @@
{
"quota_set": {
"instances": 45
}
}

View File

@ -0,0 +1,14 @@
{
"quota_set": {
"cores": 20,
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
"injected_files": 5,
"instances": 45,
"key_pairs": 100,
"metadata_items": 128,
"ram": 51200,
"server_groups": 10,
"server_group_members": 10
}
}

View File

@ -0,0 +1,15 @@
{
"quota_set": {
"cores": 20,
"id": "fake_tenant",
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
"injected_files": 5,
"instances": 10,
"key_pairs": 100,
"metadata_items": 128,
"ram": 51200,
"server_groups": 10,
"server_group_members": 10
}
}

View File

@ -0,0 +1,6 @@
{
"quota_set": {
"force": "True",
"instances": 9
}
}

View File

@ -0,0 +1,14 @@
{
"quota_set": {
"cores": 20,
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
"injected_files": 5,
"instances": 9,
"key_pairs": 100,
"metadata_items": 128,
"ram": 51200,
"server_groups": 10,
"server_group_members": 10
}
}

View File

@ -75,3 +75,8 @@ class QuotaSetsSampleJsonTests(api_sample_base.ApiSampleTestBaseV21):
{})
return self._verify_response('user-quotas-update-post-resp', {},
response, 200)
class QuotaSetsSampleJsonTests2_36(QuotaSetsSampleJsonTests):
microversion = '2.36'
scenarios = [('v2_36', {'api_major_version': 'v2.1'})]

View File

@ -0,0 +1,12 @@
---
fixes:
- |
This release includes a fix for `bug 1733886`_ which was a regression
introduced in the 2.36 API microversion where the ``force`` parameter was
missing from the ``PUT /os-quota-sets/{tenant_id}`` API request schema so
users could not force quota updates with microversion 2.36 or later. The
bug is now fixed so that the ``force`` parameter can once again be
specified during quota updates. There is no new microversion for this
change since it is an admin-only API.
.. _bug 1733886: https://bugs.launchpad.net/nova/+bug/1733886