summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorSandy Walsh <sandy.walsh@rackspace.com>2011-09-09 12:58:29 -0700
committerSandy Walsh <sandy.walsh@rackspace.com>2011-09-09 12:58:29 -0700
commit65593df54c7f547451b903ed148b0dc9ecebca19 (patch)
tree546f49ca9e5c4a943d921dd1209676ce4357e70a /nova/api
parent41086f811b3e65077dd9222db98406af59fde30f (diff)
parent128294ab9f5c03426ecb2154c48ea98186256d5b (diff)
trunk merge
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/ec2/cloud.py4
-rw-r--r--nova/api/openstack/contrib/floating_ips.py4
-rw-r--r--nova/api/openstack/views/servers.py7
3 files changed, 7 insertions, 8 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index 049ca6f93..4f7030a5a 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -1200,8 +1200,10 @@ class CloudController(object):
instances.append(instance)
else:
try:
+ # always filter out deleted instances
+ search_opts['deleted'] = False
instances = self.compute_api.get_all(context,
- search_opts=search_opts)
+ search_opts=search_opts)
except exception.NotFound:
instances = []
for instance in instances:
diff --git a/nova/api/openstack/contrib/floating_ips.py b/nova/api/openstack/contrib/floating_ips.py
index d1add8f83..d078b26c6 100644
--- a/nova/api/openstack/contrib/floating_ips.py
+++ b/nova/api/openstack/contrib/floating_ips.py
@@ -107,7 +107,7 @@ class FloatingIPController(object):
context = req.environ['nova.context']
floating_ip = self.network_api.get_floating_ip(context, id)
- if 'fixed_ip' in floating_ip:
+ if floating_ip.get('fixed_ip'):
self.network_api.disassociate_floating_ip(context,
floating_ip['address'])
@@ -161,7 +161,7 @@ class Floating_ips(extensions.ExtensionDescriptor):
raise webob.exc.HTTPBadRequest(explanation=msg)
floating_ip = self.network_api.get_floating_ip_by_ip(context, address)
- if 'fixed_ip' in floating_ip:
+ if floating_ip.get('fixed_ip'):
self.network_api.disassociate_floating_ip(context, address)
return webob.Response(status_int=202)
diff --git a/nova/api/openstack/views/servers.py b/nova/api/openstack/views/servers.py
index ac09b5864..473dc9e7e 100644
--- a/nova/api/openstack/views/servers.py
+++ b/nova/api/openstack/views/servers.py
@@ -145,6 +145,8 @@ class ViewBuilderV11(ViewBuilder):
response['server']['accessIPv4'] = inst.get('access_ip_v4') or ""
response['server']['accessIPv6'] = inst.get('access_ip_v6') or ""
+ response['server']['key_name'] = inst.get('key_name', '')
+ response['server']['config_drive'] = inst.get('config_drive')
return response
@@ -185,8 +187,6 @@ class ViewBuilderV11(ViewBuilder):
def _build_extra(self, response, inst):
self._build_links(response, inst)
response['uuid'] = inst['uuid']
- response['key_name'] = inst.get('key_name', '')
- self._build_config_drive(response, inst)
def _build_links(self, response, inst):
href = self.generate_href(inst["id"])
@@ -205,9 +205,6 @@ class ViewBuilderV11(ViewBuilder):
response["links"] = links
- def _build_config_drive(self, response, inst):
- response['config_drive'] = inst.get('config_drive')
-
def generate_href(self, server_id):
"""Create an url that refers to a specific server id."""
return os.path.join(self.base_url, self.project_id,