diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-03-25 17:37:23 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-03-25 17:37:23 +0000 |
| commit | c1ec5224d8f9950324ab4a6e3b9d4e4ebe4cb2e4 (patch) | |
| tree | 4f0e976c9218a9d8793f9057667d399491987d34 /nova | |
| parent | 2b8bd97325d304e230daedd1e9636869f82272a8 (diff) | |
| parent | c5097ab6682ee1b3021bb628e5083108e3b368d0 (diff) | |
| download | nova-c1ec5224d8f9950324ab4a6e3b9d4e4ebe4cb2e4.tar.gz nova-c1ec5224d8f9950324ab4a6e3b9d4e4ebe4cb2e4.tar.xz nova-c1ec5224d8f9950324ab4a6e3b9d4e4ebe4cb2e4.zip | |
Merge "Fixes Nova API /os-hosts missing element "zone""
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/api/openstack/compute/contrib/hosts.py | 1 | ||||
| -rw-r--r-- | nova/tests/api/openstack/compute/contrib/test_hosts.py | 2 | ||||
| -rw-r--r-- | nova/tests/integrated/api_samples/os-hosts/hosts-list-resp.xml.tpl | 12 |
3 files changed, 9 insertions, 6 deletions
diff --git a/nova/api/openstack/compute/contrib/hosts.py b/nova/api/openstack/compute/contrib/hosts.py index 3727f35d9..925ded736 100644 --- a/nova/api/openstack/compute/contrib/hosts.py +++ b/nova/api/openstack/compute/contrib/hosts.py @@ -34,6 +34,7 @@ class HostIndexTemplate(xmlutil.TemplateBuilder): elem = xmlutil.SubTemplateElement(root, 'host', selector='hosts') elem.set('host_name') elem.set('service') + elem.set('zone') return xmlutil.MasterTemplate(root, 1) diff --git a/nova/tests/api/openstack/compute/contrib/test_hosts.py b/nova/tests/api/openstack/compute/contrib/test_hosts.py index d10f97d28..60e8f6e1f 100644 --- a/nova/tests/api/openstack/compute/contrib/test_hosts.py +++ b/nova/tests/api/openstack/compute/contrib/test_hosts.py @@ -370,6 +370,8 @@ class HostSerializerTest(test.TestCase): tree[i].get('host_name')) self.assertEqual(fake_hosts.HOST_LIST[i]['service'], tree[i].get('service')) + self.assertEqual(fake_hosts.HOST_LIST[i]['zone'], + tree[i].get('zone')) def test_update_serializer_with_status(self): exemplar = dict(host='host_c1', status='enabled') diff --git a/nova/tests/integrated/api_samples/os-hosts/hosts-list-resp.xml.tpl b/nova/tests/integrated/api_samples/os-hosts/hosts-list-resp.xml.tpl index 4e9d3195d..b5971738c 100644 --- a/nova/tests/integrated/api_samples/os-hosts/hosts-list-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-hosts/hosts-list-resp.xml.tpl @@ -1,9 +1,9 @@ <?xml version='1.0' encoding='UTF-8'?> <hosts> - <host host_name="%(host_name)s" service="compute"/> - <host host_name="%(host_name)s" service="cert"/> - <host host_name="%(host_name)s" service="network"/> - <host host_name="%(host_name)s" service="scheduler"/> - <host host_name="%(host_name)s" service="conductor"/> - <host host_name="%(host_name)s" service="cells"/> + <host host_name="%(host_name)s" service="compute" zone="nova"/> + <host host_name="%(host_name)s" service="cert" zone="internal"/> + <host host_name="%(host_name)s" service="network" zone="internal"/> + <host host_name="%(host_name)s" service="scheduler" zone="internal"/> + <host host_name="%(host_name)s" service="conductor" zone="internal"/> + <host host_name="%(host_name)s" service="cells" zone="internal"/> </hosts> |
