diff options
author | Dan Smith <danms@us.ibm.com> | 2013-01-30 18:22:45 -0500 |
---|---|---|
committer | Dan Smith <danms@us.ibm.com> | 2013-01-30 19:15:49 -0500 |
commit | 57154884c47143bfd6101d4b758d5e8d45966622 (patch) | |
tree | 8b0680f00952db2ed78af59f897ea9942798403b /nova/scheduler/manager.py | |
parent | 8a8c0b2eb2ae7c5d4c1b4ffebc4674cccdd3692e (diff) | |
download | nova-57154884c47143bfd6101d4b758d5e8d45966622.tar.gz nova-57154884c47143bfd6101d4b758d5e8d45966622.tar.xz nova-57154884c47143bfd6101d4b758d5e8d45966622.zip |
Make scheduler modules pass conductor to add_instance_fault
The add_instance_fault_from_exc() method was recently changed to
take a conductor to avoid direct database access. The scheduler was
not updated for this, and thus was not passing it in a couple of
cases.
This makes those calls pass a conductor LocalAPI, resulting in direct
database access (which is desired from the scheduler). The tests that
one might have thought would catch this didn't because they mock out
the method itself. This fixes those and adds two tests that exercise
the add_instance_fault path all the way down to the DB API, which
would have caught it in the first place.
Fixes bug 1110808
Change-Id: If1c2988487d408a39fdf4080541f58f6bdac216c
Diffstat (limited to 'nova/scheduler/manager.py')
-rw-r--r-- | nova/scheduler/manager.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/nova/scheduler/manager.py b/nova/scheduler/manager.py index 23e64cd7c..e6bf1a293 100644 --- a/nova/scheduler/manager.py +++ b/nova/scheduler/manager.py @@ -26,6 +26,7 @@ import sys from nova.compute import rpcapi as compute_rpcapi from nova.compute import utils as compute_utils from nova.compute import vm_states +from nova.conductor import api as conductor_api import nova.context from nova import db from nova import exception @@ -190,6 +191,7 @@ class SchedulerManager(manager.Manager): notifications.send_update(context, old_ref, new_ref, service="scheduler") compute_utils.add_instance_fault_from_exc(context, + conductor_api.LocalAPI(), new_ref, ex, sys.exc_info()) payload = dict(request_spec=request_spec, |