summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorKen Pepple <ken.pepple@gmail.com>2011-04-08 08:04:57 +0000
committerTarmac <>2011-04-08 08:04:57 +0000
commit94e35cb15f487ab313c403e023ce84b320ab480c (patch)
tree893dccedc43c37540d0c0cddad48a6a7cfd86e90 /nova/api
parent428bc567872e2668e774681a58902610af11aacd (diff)
parentf2928ba331234f53e3051cf0ea1a5492593bedf1 (diff)
downloadnova-94e35cb15f487ab313c403e023ce84b320ab480c.tar.gz
nova-94e35cb15f487ab313c403e023ce84b320ab480c.tar.xz
nova-94e35cb15f487ab313c403e023ce84b320ab480c.zip
corrects incorrect openstack api responses for metadata (numeric/string conversion issue) and image format status (not uppercase)
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/views/images.py10
-rw-r--r--nova/api/openstack/views/servers.py2
2 files changed, 6 insertions, 6 deletions
diff --git a/nova/api/openstack/views/images.py b/nova/api/openstack/views/images.py
index 16195b050..9dec8a355 100644
--- a/nova/api/openstack/views/images.py
+++ b/nova/api/openstack/views/images.py
@@ -34,11 +34,11 @@ class ViewBuilder(object):
def _format_status(self, image):
"""Update the status field to standardize format."""
status_mapping = {
- 'pending': 'queued',
- 'decrypting': 'preparing',
- 'untarring': 'saving',
- 'available': 'active',
- 'killed': 'failed',
+ 'pending': 'QUEUED',
+ 'decrypting': 'PREPARING',
+ 'untarring': 'SAVING',
+ 'available': 'ACTIVE',
+ 'killed': 'FAILED',
}
try:
diff --git a/nova/api/openstack/views/servers.py b/nova/api/openstack/views/servers.py
index 59a0ab06f..e52bfaea3 100644
--- a/nova/api/openstack/views/servers.py
+++ b/nova/api/openstack/views/servers.py
@@ -82,7 +82,7 @@ class ViewBuilder(object):
# Return the metadata as a dictionary
metadata = {}
for item in inst.get('metadata', []):
- metadata[item['key']] = item['value']
+ metadata[item['key']] = str(item['value'])
inst_dict['metadata'] = metadata
inst_dict['hostId'] = ''