summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorNaveed Massjouni <naveedm9@gmail.com>2011-09-09 22:14:39 -0400
committerNaveed Massjouni <naveedm9@gmail.com>2011-09-09 22:14:39 -0400
commit0a8ea633b56fece6280b2ff6752e544d99d4b301 (patch)
tree07ed4b9d855d0aba9b1f7b49e1bad1ce8198643b /nova/api
parent13ee200d8265175922b5747f9e00fc31db4803fd (diff)
parent717f73909ac6ec71b9a9b0234585c862d909d2a0 (diff)
downloadnova-0a8ea633b56fece6280b2ff6752e544d99d4b301.tar.gz
nova-0a8ea633b56fece6280b2ff6752e544d99d4b301.tar.xz
nova-0a8ea633b56fece6280b2ff6752e544d99d4b301.zip
Merge from trunk
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/servers.py5
-rw-r--r--nova/api/openstack/views/servers.py7
4 files changed, 9 insertions, 11 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/servers.py b/nova/api/openstack/servers.py
index 7532313e5..5affd1f33 100644
--- a/nova/api/openstack/servers.py
+++ b/nova/api/openstack/servers.py
@@ -335,9 +335,8 @@ class Controller(object):
LOG.exception(msg)
raise exc.HTTPBadRequest(explanation=msg)
try:
- # TODO(gundlach): pass reboot_type, support soft reboot in
- # virt driver
- self.compute_api.reboot(req.environ['nova.context'], id)
+ self.compute_api.reboot(req.environ['nova.context'], id,
+ reboot_type)
except Exception, e:
LOG.exception(_("Error in reboot %s"), e)
raise exc.HTTPUnprocessableEntity()
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,