summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2017-12-15 16:10:49 +0000
committerGerrit Code Review <review@openstack.org>2017-12-15 16:10:49 +0000
commitdcdebbecedbfd79076e6a8f1cf4c393a7e38a43a (patch)
tree2fd55d10304eda59a565108d85e0a36ff7e97573
parentfbd9e860ff9e132e8f268d9f5f223f504571daa3 (diff)
parent9de9faa0f6080e0e01e676330eff293c3d15ffb2 (diff)
downloadnova-dcdebbecedbfd79076e6a8f1cf4c393a7e38a43a.tar.gz
Merge "Fix 'force' parameter in os-quota-sets PUT schema" into stable/newton
-rw-r--r--doc/api_samples/os-quota-sets/v2.36/quotas-show-defaults-get-resp.json15
-rw-r--r--doc/api_samples/os-quota-sets/v2.36/quotas-show-detail-get-resp.json55
-rw-r--r--doc/api_samples/os-quota-sets/v2.36/quotas-show-get-resp.json15
-rw-r--r--doc/api_samples/os-quota-sets/v2.36/quotas-update-force-post-req.json6
-rw-r--r--doc/api_samples/os-quota-sets/v2.36/quotas-update-force-post-resp.json (renamed from nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/quotas-update-force-resp.json.tpl)7
-rw-r--r--doc/api_samples/os-quota-sets/v2.36/quotas-update-post-req.json5
-rw-r--r--doc/api_samples/os-quota-sets/v2.36/quotas-update-post-resp.json14
-rw-r--r--doc/api_samples/os-quota-sets/v2.36/user-quotas-show-get-resp.json15
-rw-r--r--doc/api_samples/os-quota-sets/v2.36/user-quotas-update-post-req.json6
-rw-r--r--doc/api_samples/os-quota-sets/v2.36/user-quotas-update-post-resp.json14
-rw-r--r--nova/api/openstack/compute/schemas/quota_sets.py2
-rw-r--r--nova/api/openstack/rest_api_version_history.rst6
-rw-r--r--nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-show-defaults-get-resp.json.tpl15
-rw-r--r--nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-show-detail-get-resp.json.tpl55
-rw-r--r--nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-show-get-resp.json.tpl15
-rw-r--r--nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-update-force-post-req.json.tpl6
-rw-r--r--nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-update-force-post-resp.json.tpl14
-rw-r--r--nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-update-post-req.json.tpl5
-rw-r--r--nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-update-post-resp.json.tpl14
-rw-r--r--nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/user-quotas-show-get-resp.json.tpl15
-rw-r--r--nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/user-quotas-update-post-req.json.tpl6
-rw-r--r--nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/user-quotas-update-post-resp.json.tpl14
-rw-r--r--nova/tests/functional/api_sample_tests/test_quota_sets.py5
-rw-r--r--releasenotes/notes/bug-1733886-os-quota-sets-force-2.36-5866924621ecc857.yaml12
24 files changed, 329 insertions, 7 deletions
diff --git a/doc/api_samples/os-quota-sets/v2.36/quotas-show-defaults-get-resp.json b/doc/api_samples/os-quota-sets/v2.36/quotas-show-defaults-get-resp.json
new file mode 100644
index 0000000000..1a4d5e5e15
--- /dev/null
+++ b/doc/api_samples/os-quota-sets/v2.36/quotas-show-defaults-get-resp.json
@@ -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
+ }
+}
diff --git a/doc/api_samples/os-quota-sets/v2.36/quotas-show-detail-get-resp.json b/doc/api_samples/os-quota-sets/v2.36/quotas-show-detail-get-resp.json
new file mode 100644
index 0000000000..fe6762f85d
--- /dev/null
+++ b/doc/api_samples/os-quota-sets/v2.36/quotas-show-detail-get-resp.json
@@ -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
+ }
+ }
+}
diff --git a/doc/api_samples/os-quota-sets/v2.36/quotas-show-get-resp.json b/doc/api_samples/os-quota-sets/v2.36/quotas-show-get-resp.json
new file mode 100644
index 0000000000..1a4d5e5e15
--- /dev/null
+++ b/doc/api_samples/os-quota-sets/v2.36/quotas-show-get-resp.json
@@ -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
+ }
+}
diff --git a/doc/api_samples/os-quota-sets/v2.36/quotas-update-force-post-req.json b/doc/api_samples/os-quota-sets/v2.36/quotas-update-force-post-req.json
new file mode 100644
index 0000000000..460d2ac1c7
--- /dev/null
+++ b/doc/api_samples/os-quota-sets/v2.36/quotas-update-force-post-req.json
@@ -0,0 +1,6 @@
+{
+ "quota_set": {
+ "force": "True",
+ "instances": 45
+ }
+} \ No newline at end of file
diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/quotas-update-force-resp.json.tpl b/doc/api_samples/os-quota-sets/v2.36/quotas-update-force-post-resp.json
index ff23ff6ae4..935766b338 100644
--- a/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/quotas-update-force-resp.json.tpl
+++ b/doc/api_samples/os-quota-sets/v2.36/quotas-update-force-post-resp.json
@@ -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
}
}
diff --git a/doc/api_samples/os-quota-sets/v2.36/quotas-update-post-req.json b/doc/api_samples/os-quota-sets/v2.36/quotas-update-post-req.json
new file mode 100644
index 0000000000..b11081d7e4
--- /dev/null
+++ b/doc/api_samples/os-quota-sets/v2.36/quotas-update-post-req.json
@@ -0,0 +1,5 @@
+{
+ "quota_set": {
+ "instances": 45
+ }
+} \ No newline at end of file
diff --git a/doc/api_samples/os-quota-sets/v2.36/quotas-update-post-resp.json b/doc/api_samples/os-quota-sets/v2.36/quotas-update-post-resp.json
new file mode 100644
index 0000000000..935766b338
--- /dev/null
+++ b/doc/api_samples/os-quota-sets/v2.36/quotas-update-post-resp.json
@@ -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
+ }
+}
diff --git a/doc/api_samples/os-quota-sets/v2.36/user-quotas-show-get-resp.json b/doc/api_samples/os-quota-sets/v2.36/user-quotas-show-get-resp.json
new file mode 100644
index 0000000000..1a4d5e5e15
--- /dev/null
+++ b/doc/api_samples/os-quota-sets/v2.36/user-quotas-show-get-resp.json
@@ -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
+ }
+}
diff --git a/doc/api_samples/os-quota-sets/v2.36/user-quotas-update-post-req.json b/doc/api_samples/os-quota-sets/v2.36/user-quotas-update-post-req.json
new file mode 100644
index 0000000000..cbd6f18af1
--- /dev/null
+++ b/doc/api_samples/os-quota-sets/v2.36/user-quotas-update-post-req.json
@@ -0,0 +1,6 @@
+{
+ "quota_set": {
+ "force": "True",
+ "instances": 9
+ }
+} \ No newline at end of file
diff --git a/doc/api_samples/os-quota-sets/v2.36/user-quotas-update-post-resp.json b/doc/api_samples/os-quota-sets/v2.36/user-quotas-update-post-resp.json
new file mode 100644
index 0000000000..9ae2981a82
--- /dev/null
+++ b/doc/api_samples/os-quota-sets/v2.36/user-quotas-update-post-resp.json
@@ -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
+ }
+}
diff --git a/nova/api/openstack/compute/schemas/quota_sets.py b/nova/api/openstack/compute/schemas/quota_sets.py
index 38a9f80e25..fff4add743 100644
--- a/nova/api/openstack/compute/schemas/quota_sets.py
+++ b/nova/api/openstack/compute/schemas/quota_sets.py
@@ -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']
diff --git a/nova/api/openstack/rest_api_version_history.rst b/nova/api/openstack/rest_api_version_history.rst
index 89f5e22875..873b8ed2ef 100644
--- a/nova/api/openstack/rest_api_version_history.rst
+++ b/nova/api/openstack/rest_api_version_history.rst
@@ -386,6 +386,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
----
diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-show-defaults-get-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-show-defaults-get-resp.json.tpl
new file mode 100644
index 0000000000..1a4d5e5e15
--- /dev/null
+++ b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-show-defaults-get-resp.json.tpl
@@ -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
+ }
+}
diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-show-detail-get-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-show-detail-get-resp.json.tpl
new file mode 100644
index 0000000000..fe6762f85d
--- /dev/null
+++ b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-show-detail-get-resp.json.tpl
@@ -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
+ }
+ }
+}
diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-show-get-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-show-get-resp.json.tpl
new file mode 100644
index 0000000000..1a4d5e5e15
--- /dev/null
+++ b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-show-get-resp.json.tpl
@@ -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
+ }
+}
diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-update-force-post-req.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-update-force-post-req.json.tpl
new file mode 100644
index 0000000000..a58a179123
--- /dev/null
+++ b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-update-force-post-req.json.tpl
@@ -0,0 +1,6 @@
+{
+ "quota_set": {
+ "force": "True",
+ "instances": 45
+ }
+}
diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-update-force-post-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-update-force-post-resp.json.tpl
new file mode 100644
index 0000000000..935766b338
--- /dev/null
+++ b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-update-force-post-resp.json.tpl
@@ -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
+ }
+}
diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-update-post-req.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-update-post-req.json.tpl
new file mode 100644
index 0000000000..a8de270ffb
--- /dev/null
+++ b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-update-post-req.json.tpl
@@ -0,0 +1,5 @@
+{
+ "quota_set": {
+ "instances": 45
+ }
+}
diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-update-post-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-update-post-resp.json.tpl
new file mode 100644
index 0000000000..935766b338
--- /dev/null
+++ b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/quotas-update-post-resp.json.tpl
@@ -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
+ }
+}
diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/user-quotas-show-get-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/user-quotas-show-get-resp.json.tpl
new file mode 100644
index 0000000000..1a4d5e5e15
--- /dev/null
+++ b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/user-quotas-show-get-resp.json.tpl
@@ -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
+ }
+}
diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/user-quotas-update-post-req.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/user-quotas-update-post-req.json.tpl
new file mode 100644
index 0000000000..b322b2a870
--- /dev/null
+++ b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/user-quotas-update-post-req.json.tpl
@@ -0,0 +1,6 @@
+{
+ "quota_set": {
+ "force": "True",
+ "instances": 9
+ }
+}
diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/user-quotas-update-post-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/user-quotas-update-post-resp.json.tpl
new file mode 100644
index 0000000000..9ae2981a82
--- /dev/null
+++ b/nova/tests/functional/api_sample_tests/api_samples/os-quota-sets/v2.36/user-quotas-update-post-resp.json.tpl
@@ -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
+ }
+}
diff --git a/nova/tests/functional/api_sample_tests/test_quota_sets.py b/nova/tests/functional/api_sample_tests/test_quota_sets.py
index 84d79ad976..d15ce688a8 100644
--- a/nova/tests/functional/api_sample_tests/test_quota_sets.py
+++ b/nova/tests/functional/api_sample_tests/test_quota_sets.py
@@ -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'})]
diff --git a/releasenotes/notes/bug-1733886-os-quota-sets-force-2.36-5866924621ecc857.yaml b/releasenotes/notes/bug-1733886-os-quota-sets-force-2.36-5866924621ecc857.yaml
new file mode 100644
index 0000000000..64f162068e
--- /dev/null
+++ b/releasenotes/notes/bug-1733886-os-quota-sets-force-2.36-5866924621ecc857.yaml
@@ -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