From b946f22a866dfa1151fbbf70fad1d98dfceaefe8 Mon Sep 17 00:00:00 2001 From: Chris Behrens Date: Thu, 1 Nov 2012 18:13:08 +0000 Subject: 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 --- nova/compute/manager.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'nova/compute') diff --git a/nova/compute/manager.py b/nova/compute/manager.py index dac9b58a0..7b2dc4d1d 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -342,6 +342,13 @@ class ComputeManager(manager.SchedulerDependentManager): self._report_driver_status(context) self.publish_service_capabilities(context) + def pre_start_hook(self): + """After the service is initialized, but before we fully bring + the service up by listening on RPC queues, make sure to update + our available resources. + """ + self.update_available_resource(nova.context.get_admin_context()) + def _get_power_state(self, context, instance): """Retrieve the power state for the given instance.""" LOG.debug(_('Checking state'), instance=instance) -- cgit