summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorBrian Lamar <brian.lamar@rackspace.com>2011-04-21 16:18:49 -0400
committerBrian Lamar <brian.lamar@rackspace.com>2011-04-21 16:18:49 -0400
commit18388b26c0e28df103d07ad0cc28fd9bfaab6416 (patch)
tree526b9004c1f6c7eeb82dcff2aa96a6b4f7596bac /nova/api
parent6c037c5c639249556fcadd871d8af91760b50e90 (diff)
parentbec71bed9450d13202fdd7f54946e1376b271a2c (diff)
Merged trunk and fixed api servers conflict.
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/ec2/cloud.py2
-rw-r--r--nova/api/openstack/servers.py14
2 files changed, 9 insertions, 7 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index bd4c9dcd4..4785d812a 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -187,7 +187,7 @@ class CloudController(object):
'mpi': mpi}}
for image_type in ['kernel', 'ramdisk']:
- if '%s_id' % image_type in instance_ref:
+ if instance_ref.get('%s_id' % image_type):
ec2_id = self._image_ec2_id(instance_ref['%s_id' % image_type],
self._image_type(image_type))
data['meta-data']['%s-id' % image_type] = ec2_id
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index a7e240917..63ef8c811 100644
--- a/nova/api/openstack/servers.py
+++ b/nova/api/openstack/servers.py
@@ -40,7 +40,7 @@ import nova.api.openstack
from nova.scheduler import api as scheduler_api
-LOG = logging.getLogger('server')
+LOG = logging.getLogger('nova.api.openstack.servers')
FLAGS = flags.FLAGS
@@ -333,18 +333,20 @@ class Controller(common.OpenstackController):
except Exception, e:
LOG.exception(_("Error in resize %s"), e)
return faults.Fault(exc.HTTPBadRequest())
- return faults.Fault(exc.HTTPAccepted())
+ return exc.HTTPAccepted()
def _action_reboot(self, input_dict, req, id):
- try:
+ if 'reboot' in input_dict and 'type' in input_dict['reboot']:
reboot_type = input_dict['reboot']['type']
- except Exception:
- raise faults.Fault(exc.HTTPNotImplemented())
+ else:
+ LOG.exception(_("Missing argument 'type' for reboot"))
+ return faults.Fault(exc.HTTPUnprocessableEntity())
try:
# TODO(gundlach): pass reboot_type, support soft reboot in
# virt driver
self.compute_api.reboot(req.environ['nova.context'], id)
- except:
+ except Exception, e:
+ LOG.exception(_("Error in reboot %s"), e)
return faults.Fault(exc.HTTPUnprocessableEntity())
return exc.HTTPAccepted()