diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-01-18 23:20:45 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-01-18 23:20:45 +0000 |
| commit | b2a5efcd050c98ef5c09db02fa06e75481d8e20e (patch) | |
| tree | 27546ace85199721b6ecb115b93a6b65f8f9ff49 /nova | |
| parent | dc39e196373c90eacf48a236a6836c793f896312 (diff) | |
| parent | 2cd3b86742c6f9c2452e4c1ac7dbd45fb92dd5b0 (diff) | |
| download | nova-b2a5efcd050c98ef5c09db02fa06e75481d8e20e.tar.gz nova-b2a5efcd050c98ef5c09db02fa06e75481d8e20e.tar.xz nova-b2a5efcd050c98ef5c09db02fa06e75481d8e20e.zip | |
Merge "disk_config extension now uses OS prefix."
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/api/openstack/compute/contrib/disk_config.py | 4 | ||||
| -rw-r--r-- | nova/tests/api/openstack/compute/contrib/test_disk_config.py | 18 |
2 files changed, 13 insertions, 9 deletions
diff --git a/nova/api/openstack/compute/contrib/disk_config.py b/nova/api/openstack/compute/contrib/disk_config.py index 30aac0acc..cf78b847e 100644 --- a/nova/api/openstack/compute/contrib/disk_config.py +++ b/nova/api/openstack/compute/contrib/disk_config.py @@ -24,8 +24,8 @@ from nova.api.openstack import xmlutil from nova import db from nova import utils -ALIAS = 'RAX-DCF' -XMLNS_DCF = "http://docs.rackspacecloud.com/servers/api/ext/diskConfig/v1.0" +ALIAS = 'OS-DCF' +XMLNS_DCF = "http://docs.openstack.org/compute/ext/disk_config/api/v1.1" API_DISK_CONFIG = "%s:diskConfig" % ALIAS INTERNAL_DISK_CONFIG = "auto_disk_config" diff --git a/nova/tests/api/openstack/compute/contrib/test_disk_config.py b/nova/tests/api/openstack/compute/contrib/test_disk_config.py index bd995fd3d..b897c5e71 100644 --- a/nova/tests/api/openstack/compute/contrib/test_disk_config.py +++ b/nova/tests/api/openstack/compute/contrib/test_disk_config.py @@ -35,6 +35,9 @@ stub_instance = fakes.stub_instance FLAGS = flags.FLAGS +API_DISK_CONFIG = 'OS-DCF:diskConfig' + + def instance_addresses(context, instance_id): return None @@ -123,8 +126,8 @@ class DiskConfigTestCase(test.TestCase): self.app = app def assertDiskConfig(self, dict_, value): - self.assert_('RAX-DCF:diskConfig' in dict_) - self.assertEqual(dict_['RAX-DCF:diskConfig'], value) + self.assert_(API_DISK_CONFIG in dict_) + self.assertEqual(dict_[API_DISK_CONFIG], value) def test_show_server(self): req = fakes.HTTPRequest.blank( @@ -181,7 +184,7 @@ class DiskConfigTestCase(test.TestCase): 'name': 'server_test', 'imageRef': 'cedef40a-ed67-4d10-800e-17455edce175', 'flavorRef': '1', - 'RAX-DCF:diskConfig': 'AUTO' + API_DISK_CONFIG: 'AUTO' }} req.body = utils.dumps(body) @@ -197,7 +200,7 @@ class DiskConfigTestCase(test.TestCase): 'name': 'server_test', 'imageRef': 'cedef40a-ed67-4d10-800e-17455edce175', 'flavorRef': '1', - 'RAX-DCF:diskConfig': 'MANUAL' + API_DISK_CONFIG: 'MANUAL' }} req.body = utils.dumps(body) @@ -243,10 +246,11 @@ class DiskConfigTestCase(test.TestCase): '/fake/servers/%s' % MANUAL_INSTANCE_UUID) req.method = 'PUT' req.content_type = 'application/json' - body = {'server': {'RAX-DCF:diskConfig': 'server_test'}} + body = {'server': {API_DISK_CONFIG: 'server_test'}} req.body = utils.dumps(body) res = req.get_response(self.app) self.assertEqual(res.status_int, 400) - expected_msg = '{"badRequest": {"message": "RAX-DCF:diskConfig must'\ - ' be either \'MANUAL\' or \'AUTO\'.", "code": 400}}' + expected_msg = ('{"badRequest": {"message": "%s must be either' + ' \'MANUAL\' or \'AUTO\'.", "code": 400}}' % + API_DISK_CONFIG) self.assertEqual(res.body, expected_msg) |
