diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-04-05 15:45:01 -0700 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-04-05 15:45:01 -0700 |
| commit | 5f414311fb581ba612cf152f3ec9983d5f39c2e4 (patch) | |
| tree | c69c2b2c2f85050310c59d3e8b4fda520400e160 | |
| parent | 8eff0a91bbc475d8559b39fb81e1a62beda841f3 (diff) | |
| download | nova-5f414311fb581ba612cf152f3ec9983d5f39c2e4.tar.gz nova-5f414311fb581ba612cf152f3ec9983d5f39c2e4.tar.xz nova-5f414311fb581ba612cf152f3ec9983d5f39c2e4.zip | |
fallback to status if image_state is not set
| -rw-r--r-- | nova/api/ec2/cloud.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index b4705820e..4e5b8bfc6 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -920,7 +920,11 @@ class CloudController(object): get('image_location'), name) else: i['imageLocation'] = image['properties'].get('image_location') - i['imageState'] = image['properties'].get('image_state') + # NOTE(vish): fallback status if image_state isn't set + state = image.get('status') + if state == 'active': + state = 'available' + i['imageState'] = image['properties'].get('image_state', state) i['displayName'] = name i['description'] = image.get('description') display_mapping = {'aki': 'kernel', |
