diff --git a/doc/api_samples/os-server-tags/v2.26/server-tags-put-req.json b/doc/api_samples/os-server-tags/v2.26/server-tags-put-req.json deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-server-tags/v2.26/server-tags-put-req.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-server-tags/v2.26/server-tags-put-req.json.tpl deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/nova/tests/functional/api_sample_tests/test_server_tags.py b/nova/tests/functional/api_sample_tests/test_server_tags.py index c808c3b921b2..77ed3e19640d 100644 --- a/nova/tests/functional/api_sample_tests/test_server_tags.py +++ b/nova/tests/functional/api_sample_tests/test_server_tags.py @@ -76,8 +76,7 @@ class ServerTagsJsonTest(test_servers.ServersSampleBase): tag = models.Tag() tag.resource_id = uuid tag.tag = 'OtherTag' - response = self._do_put('servers/%s/tags/%s' % (uuid, tag.tag), - 'server-tags-put-req', {}) + response = self._do_put('servers/%s/tags/%s' % (uuid, tag.tag)) self.assertEqual(201, response.status_code) expected_location = "%s/servers/%s/tags/%s" % ( self._get_vers_compute_endpoint(), uuid, tag.tag) diff --git a/nova/tests/functional/api_samples_test_base.py b/nova/tests/functional/api_samples_test_base.py index f008d0cac7af..fa617fdaa1f1 100644 --- a/nova/tests/functional/api_samples_test_base.py +++ b/nova/tests/functional/api_samples_test_base.py @@ -466,8 +466,15 @@ class ApiSampleTestBase(integrated_helpers._IntegratedTestBase): self._write_sample(name, body) return self._get_response(url, method, body, headers=headers) - def _do_put(self, url, name, subs, headers=None): - return self._do_post(url, name, subs, method='PUT', headers=headers) + def _do_put(self, url, name=None, subs=None, headers=None): + # name indicates that we have a body document. While the HTTP + # spec implies that PUT is supposed to have one, we have some + # APIs which don't. + if name: + return self._do_post( + url, name, subs, method='PUT', headers=headers) + else: + return self._get_response(url, 'PUT', headers=headers) def _do_delete(self, url, headers=None): return self._get_response(url, 'DELETE', headers=headers)