diff --git a/doc/api_samples/os-evacuate/v2.29/server-evacuate-find-host-req.json b/doc/api_samples/os-evacuate/v2.29/server-evacuate-find-host-req.json new file mode 100644 index 000000000000..bb3a11d97994 --- /dev/null +++ b/doc/api_samples/os-evacuate/v2.29/server-evacuate-find-host-req.json @@ -0,0 +1,5 @@ +{ + "evacuate": { + "adminPass": "MySecretPass" + } +} \ No newline at end of file diff --git a/nova/tests/functional/api_sample_tests/api_samples/consoles/consoles-create-req.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/consoles/consoles-create-req.json.tpl deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-floating-ips/floating-ips-create-nopool-req.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-floating-ips/floating-ips-create-nopool-req.json.tpl deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/nova/tests/functional/api_sample_tests/test_consoles.py b/nova/tests/functional/api_sample_tests/test_consoles.py index bb227b4756dc..1e190674fdcd 100644 --- a/nova/tests/functional/api_sample_tests/test_consoles.py +++ b/nova/tests/functional/api_sample_tests/test_consoles.py @@ -33,8 +33,7 @@ class ConsolesSamplesJsonTest(test_servers.ServersSampleBase): self.console = self.start_service('console', host='fake') def _create_consoles(self, server_uuid): - response = self._do_post('servers/%s/consoles' % server_uuid, - 'consoles-create-req', {}) + response = self._do_post('servers/%s/consoles' % server_uuid) self.assertEqual(response.status_code, 200) def test_create_consoles(self): diff --git a/nova/tests/functional/api_sample_tests/test_floating_ips.py b/nova/tests/functional/api_sample_tests/test_floating_ips.py index ed534a436296..48f807053d2b 100644 --- a/nova/tests/functional/api_sample_tests/test_floating_ips.py +++ b/nova/tests/functional/api_sample_tests/test_floating_ips.py @@ -60,21 +60,15 @@ class FloatingIpsTest(api_sample_base.ApiSampleTestBaseV21): {}, response, 200) def test_floating_ips_list(self): - self._do_post('os-floating-ips', - 'floating-ips-create-nopool-req', - {}) - self._do_post('os-floating-ips', - 'floating-ips-create-nopool-req', - {}) + self._do_post('os-floating-ips') + self._do_post('os-floating-ips') response = self._do_get('os-floating-ips') self._verify_response('floating-ips-list-resp', {}, response, 200) def test_floating_ips_create_nopool(self): - response = self._do_post('os-floating-ips', - 'floating-ips-create-nopool-req', - {}) + response = self._do_post('os-floating-ips') self._verify_response('floating-ips-create-resp', {}, response, 200) diff --git a/nova/tests/functional/api_samples_test_base.py b/nova/tests/functional/api_samples_test_base.py index 848f8ea9e522..130c064a86aa 100644 --- a/nova/tests/functional/api_samples_test_base.py +++ b/nova/tests/functional/api_samples_test_base.py @@ -495,12 +495,14 @@ class ApiSampleTestBase(integrated_helpers._IntegratedTestBase): return jsonutils.loads(response.content) return response - def _do_post(self, url, name, subs, method='POST', headers=None): - self.subs = subs - body = self._read_template(name) % self.subs - sample = self._get_sample(name, self.microversion) - if self.generate_samples and not os.path.exists(sample): - self._write_sample(name, body) + def _do_post(self, url, name=None, subs=None, method='POST', headers=None): + self.subs = {} if subs is None else subs + body = None + if name: + body = self._read_template(name) % self.subs + sample = self._get_sample(name, self.microversion) + if self.generate_samples and not os.path.exists(sample): + self._write_sample(name, body) return self._get_response(url, method, body, headers=headers) def _do_put(self, url, name=None, subs=None, headers=None):