diff options
| author | Trey Morris <trey.morris@rackspace.com> | 2010-12-20 21:12:20 +0000 |
|---|---|---|
| committer | Trey Morris <trey.morris@rackspace.com> | 2010-12-20 21:12:20 +0000 |
| commit | b5756f6abf582b04a5fe6744d6a139b12440e35a (patch) | |
| tree | 7b7f75e7f5028c2e853e2399b1481d9a1395cf2c /nova/api | |
| parent | d71b9a34c3f76f95227da0f7a746cc5a1a76da24 (diff) | |
fixed some pep8 business
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/images.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/nova/api/openstack/images.py b/nova/api/openstack/images.py index df5e1530f..0f808a6bf 100644 --- a/nova/api/openstack/images.py +++ b/nova/api/openstack/images.py @@ -27,11 +27,13 @@ from nova.api.openstack import faults FLAGS = flags.FLAGS + def _entity_list(entities): """ Coerces a list of images into proper dictionary format entities is a list of entities (dicts) """ return dict(images=entities) + def _entity_detail(inst): """ Maps everything to Rackspace-like attributes for return also pares down attributes to those we want @@ -44,27 +46,29 @@ def _entity_detail(inst): # 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_keys = {'status': 'imageState', + 'id': 'imageId', + 'name': 'imageLocation'} mapped_inst = {} - for k,v in mapped_keys.iteritems(): + for k, v in mapped_keys.iteritems(): mapped_inst[k] = inst[v] mapped_inst['status'] = status_mapping[mapped_inst['status']] return mapped_inst + def _entity_inst(inst): """ Filters all model attributes save for id and name inst is a single entity (dict) """ - return _select_keys(inst, ['id','name']) + return _select_keys(inst, ['id', 'name']) + 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) + return dict((k, v) for k, v in inst.iteritems() if k in keys) class Controller(wsgi.Controller): |
