summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorWilliam Wolf <throughnothing@gmail.com>2011-06-21 12:33:40 -0400
committerWilliam Wolf <throughnothing@gmail.com>2011-06-21 12:33:40 -0400
commitb328e9719a8ea6450f0bb35152b37d6f7869ba95 (patch)
treee2d4db8cfdba9993d5349087b533d21ce505c225 /nova/compute
parent6faecbb9617dfc2da283c7b46be36f512db14287 (diff)
parenta62e0f3e10cae4938ca2fec047268064cab3bff2 (diff)
merge from trunk
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/api.py11
-rw-r--r--nova/compute/manager.py1
2 files changed, 9 insertions, 3 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index b81aecb70..e6cffb6b3 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -579,8 +579,15 @@ class API(base.Base):
def get(self, context, instance_id):
"""Get a single instance with the given instance_id."""
- rv = self.db.instance_get(context, instance_id)
- return dict(rv.iteritems())
+ # NOTE(sirp): id used to be exclusively integer IDs; now we're
+ # accepting both UUIDs and integer IDs. The handling of this
+ # is done in db/sqlalchemy/api/instance_get
+ if utils.is_uuid_like(instance_id):
+ uuid = instance_id
+ instance = self.db.instance_get_by_uuid(context, uuid)
+ else:
+ instance = self.db.instance_get(context, instance_id)
+ return dict(instance.iteritems())
@scheduler_api.reroute_compute("get")
def routing_get(self, context, instance_id):
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index e53ff75fc..727cd683c 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -791,7 +791,6 @@ class ComputeManager(manager.SchedulerDependentManager):
def get_diagnostics(self, context, instance_id):
"""Retrieve diagnostics for an instance on this host."""
instance_ref = self.db.instance_get(context, instance_id)
-
if instance_ref["state"] == power_state.RUNNING:
LOG.audit(_("instance %s: retrieving diagnostics"), instance_id,
context=context)