diff options
| author | Brian Waldon <brian.waldon@rackspace.com> | 2011-03-21 15:14:24 -0400 |
|---|---|---|
| committer | Brian Waldon <brian.waldon@rackspace.com> | 2011-03-21 15:14:24 -0400 |
| commit | 85f50cf496e2c193ddc715f3019b4a4769ab5bd9 (patch) | |
| tree | 04fa72105fadc9b39021e5ec5af364148d9f9eab /nova/api | |
| parent | 79f2f90feec74b97d55af058c9bec4177bc47a54 (diff) | |
pep8; various fixes
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/servers.py | 1 | ||||
| -rw-r--r-- | nova/api/openstack/views/servers.py | 5 |
2 files changed, 3 insertions, 3 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index e3141934b..dafc096ba 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -513,6 +513,7 @@ class Controller(wsgi.Controller): return kernel_id, ramdisk_id + class ControllerV10(Controller): def _image_id_from_req_data(self, data): return data['server']['imageId'] diff --git a/nova/api/openstack/views/servers.py b/nova/api/openstack/views/servers.py index 8d47ac757..078d5d484 100644 --- a/nova/api/openstack/views/servers.py +++ b/nova/api/openstack/views/servers.py @@ -67,9 +67,8 @@ class ViewBuilder(object): # Return the metadata as a dictionary metadata = {} - if 'metadata' in inst: - for item in inst['metadata']: - metadata[item['key']] = item['value'] + for item in inst.get('metadata', []): + metadata[item['key']] = item['value'] inst_dict['metadata'] = metadata inst_dict['hostId'] = '' |
