diff options
| author | Trey Morris <trey.morris@rackspace.com> | 2010-12-19 23:51:17 +0000 |
|---|---|---|
| committer | Trey Morris <trey.morris@rackspace.com> | 2010-12-19 23:51:17 +0000 |
| commit | d71b9a34c3f76f95227da0f7a746cc5a1a76da24 (patch) | |
| tree | 3a0efac06ba56cfb6fc7655ac13232f052d1ec5d /nova/api | |
| parent | fc1354a639edb1c3a7f979f58bb90918c63695ab (diff) | |
small clean up
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/images.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/nova/api/openstack/images.py b/nova/api/openstack/images.py index 7f2be5472..df5e1530f 100644 --- a/nova/api/openstack/images.py +++ b/nova/api/openstack/images.py @@ -41,9 +41,14 @@ def _entity_detail(inst): 'decrypting': 'preparing', 'untarring': 'saving', 'available': 'active'} - mapped_inst = {} - mapped_keys = {'status':'imageState', 'id':'imageId', 'name':'imageLocation'} + # TODO(tr3buchet): this map is specific to s3 object store, + # fix once the local image service is working + mapped_keys = {'status':'imageState', + 'id':'imageId', + 'name':'imageLocation'} + + mapped_inst = {} for k,v in mapped_keys.iteritems(): mapped_inst[k] = inst[v] @@ -54,9 +59,9 @@ def _entity_detail(inst): def _entity_inst(inst): """ Filters all model attributes save for id and name inst is a single entity (dict) """ - return _filter_keys(inst, ['id','name']) + return _select_keys(inst, ['id','name']) -def _filter_keys(inst, keys): +def _select_keys(inst, keys): """ Filters all model attributes for keys inst is a single entity (dict) """ return dict( (k,v) for k,v in inst.iteritems() if k in keys) |
