diff options
| author | Brian Waldon <brian.waldon@rackspace.com> | 2011-09-12 21:21:54 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-09-12 21:21:54 +0000 |
| commit | 9f39ff070b5500a0ccb9a6454995f97342254381 (patch) | |
| tree | e3309a2b2a0ec5044d3243f42123607b71cd3697 /nova/api | |
| parent | 68551bb375588470b41606f181c445192c18cdaa (diff) | |
| parent | 9b8e73d9ef1a5bd4efb460f3a0c033fc748ccdd9 (diff) | |
| download | nova-9f39ff070b5500a0ccb9a6454995f97342254381.tar.gz nova-9f39ff070b5500a0ccb9a6454995f97342254381.tar.xz nova-9f39ff070b5500a0ccb9a6454995f97342254381.zip | |
Correctly map image statuses from Glance to OSAPI v1.1
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/views/images.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/nova/api/openstack/views/images.py b/nova/api/openstack/views/images.py index 21f1b2d3e..8983b2957 100644 --- a/nova/api/openstack/views/images.py +++ b/nova/api/openstack/views/images.py @@ -37,17 +37,18 @@ 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', + 'active': 'ACTIVE', + 'queued': 'SAVING', + 'saving': 'SAVING', + 'deleted': 'DELETED', + 'pending_delete': 'DELETED', + 'killed': 'ERROR', } try: - image['status'] = status_mapping[image['status']].upper() + image['status'] = status_mapping[image['status']] except KeyError: - image['status'] = image['status'].upper() + image['status'] = 'UNKNOWN' def _build_server(self, image, image_obj): """Indicates that you must use a ViewBuilder subclass.""" |
