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
This commit is contained in:
Chris Behrens
2012-11-01 18:13:08 +00:00
parent a079296c6e
commit 19fac8eec9
3 changed files with 34 additions and 8 deletions

View File

@@ -183,10 +183,30 @@ class Manager(base.Base):
locals())
def init_host(self):
"""Handle initialization if this is a standalone service.
"""Hook to do additional manager initialization when one requests
the service be started. This is called before any service record
is created.
Child classes should override this method.
"""
pass
def pre_start_hook(self):
"""Hook to provide the manager the ability to do additional
start-up work before any RPC queues/consumers are created. This is
called after other initialization has succeeded and a service
record is created.
Child classes should override this method.
"""
pass
def post_start_hook(self):
"""Hook to provide the manager the ability to do additional
start-up work immediately after a service creates RPC consumers
and starts 'running'.
Child classes should override this method.
"""
pass