diff options
| author | Brian Waldon <brian.waldon@rackspace.com> | 2011-02-17 09:48:16 -0500 |
|---|---|---|
| committer | Brian Waldon <brian.waldon@rackspace.com> | 2011-02-17 09:48:16 -0500 |
| commit | e28ce7f82d1c89ab0c4e5ebfa98c12f502a33138 (patch) | |
| tree | fea2fe8d9bf4b5165498dbb288056f8ba023204b | |
| parent | 8074ecf9f8e8d4e24909e2255e40da4c5fa9ce9e (diff) | |
removing superfluous pass statements; replacing list comprehension with for loop; alphabetizing imports
| -rw-r--r-- | nova/api/openstack/servers.py | 6 | ||||
| -rw-r--r-- | nova/tests/api/openstack/test_servers.py | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index 60f3d96e3..312d83ba5 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -72,15 +72,13 @@ def _translate_detail_keys(inst): inst_dict['addresses']['private'].append(private_ip) except KeyError: LOG.debug(_("Failed to read private ip")) - pass # grab all public floating ips try: - [inst_dict['addresses']['public'].append(floating['address']) \ - for floating in inst['fixed_ip']['floating_ips']] + for floating in inst['fixed_ip']['floating_ips']: + inst_dict['addresses']['public'].append(floating['address']) except KeyError: LOG.debug(_("Failed to read public ip(s)")) - pass inst_dict['metadata'] = {} inst_dict['hostId'] = '' diff --git a/nova/tests/api/openstack/test_servers.py b/nova/tests/api/openstack/test_servers.py index 816a0ab8c..ace3b6850 100644 --- a/nova/tests/api/openstack/test_servers.py +++ b/nova/tests/api/openstack/test_servers.py @@ -15,9 +15,9 @@ # License for the specific language governing permissions and limitations # under the License. +import datetime import json import unittest -import datetime import stubout import webob |
