summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorRick Harris <rick.harris@rackspace.com>2011-06-16 15:02:18 +0000
committerRick Harris <rick.harris@rackspace.com>2011-06-16 15:02:18 +0000
commit70685ba0ed01685f8643c499ca78ef57763ed3b5 (patch)
treee91a7b94b5f7eb6081e21eed0b144f215cf84576 /nova
parent96a49e768037a2582c294d51a1cb3a330478507d (diff)
Small tweaks
Diffstat (limited to 'nova')
-rw-r--r--nova/compute/manager.py1
-rw-r--r--nova/db/sqlalchemy/models.py2
-rw-r--r--nova/scheduler/api.py14
3 files changed, 7 insertions, 10 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 245958de7..00bdbf3f2 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -693,7 +693,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)
diff --git a/nova/db/sqlalchemy/models.py b/nova/db/sqlalchemy/models.py
index a1b47eded..7bdfbacd0 100644
--- a/nova/db/sqlalchemy/models.py
+++ b/nova/db/sqlalchemy/models.py
@@ -233,7 +233,7 @@ class Instance(BASE, NovaBase):
os_type = Column(String(255))
vm_mode = Column(String(255))
- uuid = Column(String(32))
+ uuid = Column(String(36))
# TODO(vish): see Ewan's email about state improvements, probably
# should be in a driver base class or some such
diff --git a/nova/scheduler/api.py b/nova/scheduler/api.py
index 0cc8a1132..8bf6a1592 100644
--- a/nova/scheduler/api.py
+++ b/nova/scheduler/api.py
@@ -225,10 +225,6 @@ class reroute_compute(object):
def __init__(self, method_name):
self.method_name = method_name
-
- def _route_local():
- pass
-
def _route_to_child_zones(context, collection, item_uuid):
if not FLAGS.enable_zone_routing:
raise InstanceNotFound(instance_id=item_uuid)
@@ -255,8 +251,7 @@ class reroute_compute(object):
if utils.is_uuid_like(item_id_or_uuid):
item_uuid = item_id_or_uuid
try:
- instance = self.db.instance_get_by_uuid(
- context, item_uuid)
+ instance = db.instance_get_by_uuid(context, item_uuid)
except exception.InstanceNotFound, e:
# NOTE(sirp): since a UUID was passed in, we can attempt
# to reroute to a child zone
@@ -269,10 +264,11 @@ class reroute_compute(object):
# integer ID in the argument list so that the zone-local code
# can continue to use integer IDs.
item_id = instance['id']
- self.replace_uuid_with_id(args, kwargs, replacement_id)
+ args = list(args) # needs to be mutable to replace
+ self.replace_uuid_with_id(args, kwargs, item_id)
if attempt_reroute:
- self._route_to_child_zones(context, collection, item_uuid)
+ return self._route_to_child_zones(context, collection, item_uuid)
else:
return f(*args, **kwargs)
@@ -303,6 +299,8 @@ class reroute_compute(object):
if 'instance_id' in kwargs:
kwargs['instance_id'] = replacement_id
elif len(args) > 1:
+ # NOTE(sirp): args comes in as a tuple, so we need to convert it
+ # to a list to mutate it, and then convert it back to a tuple
args.pop(2)
args.insert(2, replacement_id)