summaryrefslogtreecommitdiffstats
path: root/nova/scheduler
diff options
context:
space:
mode:
authorSandy Walsh <sandy.walsh@rackspace.com>2011-03-16 06:47:27 -0700
committerSandy Walsh <sandy.walsh@rackspace.com>2011-03-16 06:47:27 -0700
commit8dffae687e78a1fa2a8cf0d321d64ee95a35cc1f (patch)
tree65474ed1361f1cc472371ef558d19cf6a0b3fdfc /nova/scheduler
parentddeede35a5036aa3c80742fde69468aedbc74892 (diff)
downloadnova-8dffae687e78a1fa2a8cf0d321d64ee95a35cc1f.tar.gz
nova-8dffae687e78a1fa2a8cf0d321d64ee95a35cc1f.tar.xz
nova-8dffae687e78a1fa2a8cf0d321d64ee95a35cc1f.zip
Checks locally before routing
Diffstat (limited to 'nova/scheduler')
-rw-r--r--nova/scheduler/api.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/nova/scheduler/api.py b/nova/scheduler/api.py
index c0e28a0a9..48da5bcfc 100644
--- a/nova/scheduler/api.py
+++ b/nova/scheduler/api.py
@@ -76,11 +76,16 @@ class API(object):
@classmethod
def get_instance_or_reroute(cls, context, instance_id):
- instance = db.instance_get(context, instance_id)
- zones = db.zone_get_all(context)
+ try:
+ instance = db.instance_get(context, instance_id)
+ return instance
+ except exception.InstanceNotFound, e:
+ LOG.debug(_("Instance %(instance_id)s not found locally: '%(e)s'" %
+ locals()))
- LOG.debug("*** Firing ZoneRouteException")
# Throw a reroute Exception for the middleware to pick up.
+ LOG.debug("Firing ZoneRouteException")
+ zones = db.zone_get_all(context)
raise exception.ZoneRouteException(zones)
@classmethod