summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorSandy Walsh <sandy.walsh@rackspace.com>2011-01-05 03:51:21 -0400
committerSandy Walsh <sandy.walsh@rackspace.com>2011-01-05 03:51:21 -0400
commite774f2cd7206b5ae632a42c1eda7330858b1613c (patch)
treedc8911f4cf5a8b767b4c4c71c80ec554cfc11251 /nova/api
parent53127ca97729fd60a51588dea397dda3a9e80b3b (diff)
downloadnova-e774f2cd7206b5ae632a42c1eda7330858b1613c.tar.gz
nova-e774f2cd7206b5ae632a42c1eda7330858b1613c.tar.xz
nova-e774f2cd7206b5ae632a42c1eda7330858b1613c.zip
pep8
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/common.py4
-rw-r--r--nova/api/openstack/images.py2
-rw-r--r--nova/api/openstack/servers.py8
3 files changed, 7 insertions, 7 deletions
diff --git a/nova/api/openstack/common.py b/nova/api/openstack/common.py
index e2c7ed7ba..037ed47a0 100644
--- a/nova/api/openstack/common.py
+++ b/nova/api/openstack/common.py
@@ -47,8 +47,8 @@ def get_image_id_from_image_hash(image_service, context, image_hash):
"""
# FIX(sandy): This is terribly inefficient. It pulls all images
- # from objectstore in order to find the match. ObjectStore
- # should have a numeric counterpart to the string ID.
+ # from objectstore in order to find the match. ObjectStore
+ # should have a numeric counterpart to the string ID.
try:
items = image_service.detail(context)
except NotImplementedError:
diff --git a/nova/api/openstack/images.py b/nova/api/openstack/images.py
index 4da3b943b..42ffd22a5 100644
--- a/nova/api/openstack/images.py
+++ b/nova/api/openstack/images.py
@@ -124,7 +124,7 @@ class Controller(wsgi.Controller):
items = self._service.index(req.environ['nova.context'])
for image in items:
_convert_image_id_to_hash(image)
-
+
items = common.limited(items, req)
items = [_translate_keys(item) for item in items]
items = [_translate_status(item) for item in items]
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index a5de62230..024de0072 100644
--- a/nova/api/openstack/servers.py
+++ b/nova/api/openstack/servers.py
@@ -132,11 +132,11 @@ class Controller(wsgi.Controller):
with open(mapping_filename) as f:
mapping = json.load(f)
- if mapping.has_key(image_id):
+ if image_id in mapping:
return mapping[image_id]
raise exception.NotFound(
- _("No entry for image '%s' in mapping file '%s'") %
+ _("No entry for image '%s' in mapping file '%s'") %
(image_id, mapping_filename))
def create(self, req):
@@ -154,8 +154,8 @@ class Controller(wsgi.Controller):
req.environ['nova.context'],
instance_types.get_by_flavor_id(env['server']['flavorId']),
image_id,
- kernel_id = kernel_id,
- ramdisk_id = ramdisk_id,
+ kernel_id=kernel_id,
+ ramdisk_id=ramdisk_id,
display_name=env['server']['name'],
description=env['server']['name'],
key_name=key_pair['name'],