diff options
author | Chris Behrens <cbehrens@codestud.com> | 2012-11-01 18:13:08 +0000 |
---|---|---|
committer | Chris Behrens <cbehrens@codestud.com> | 2012-11-01 19:15:09 +0000 |
commit | b946f22a866dfa1151fbbf70fad1d98dfceaefe8 (patch) | |
tree | df68a4fb151d1d12d56cb67e45bc85b96155d8d4 /nova/scheduler | |
parent | 6ee9883b8cb1ef8e503a03229a100e50813abe5a (diff) | |
download | nova-b946f22a866dfa1151fbbf70fad1d98dfceaefe8.tar.gz nova-b946f22a866dfa1151fbbf70fad1d98dfceaefe8.tar.xz nova-b946f22a866dfa1151fbbf70fad1d98dfceaefe8.zip |
Add some hooks for managers when service starts
Adds pre_start_hook() and post_start_hook() and fixes a couple of hard
coded binary name checks in service.py
Change-Id: I062790a88ed7f15a6f28961d6ddc1f230e19e0cb
Diffstat (limited to 'nova/scheduler')
-rw-r--r-- | nova/scheduler/manager.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/nova/scheduler/manager.py b/nova/scheduler/manager.py index 4c3f8025a..0703e030a 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 +import nova.context from nova import db from nova import exception from nova import flags @@ -62,6 +63,13 @@ class SchedulerManager(manager.Manager): self.driver = importutils.import_object(scheduler_driver) super(SchedulerManager, self).__init__(*args, **kwargs) + def post_start_hook(self): + """After we start up and can receive messages via RPC, tell all + compute nodes to send us their capabilities. + """ + ctxt = nova.context.get_admin_context() + compute_rpcapi.ComputeAPI().publish_service_capabilities(ctxt) + def update_service_capabilities(self, context, service_name, host, capabilities): """Process a capability update from a service node.""" @@ -259,6 +267,3 @@ class SchedulerManager(manager.Manager): @manager.periodic_task def _expire_reservations(self, context): QUOTAS.expire(context) - - def request_service_capabilities(self, context): - compute_rpcapi.ComputeAPI().publish_service_capabilities(context) |