diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-01-23 17:30:40 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-01-23 17:30:40 +0000 |
commit | 594689da5fa1187120d34969933e73d279164666 (patch) | |
tree | 53d1d9f850fe141e56cb5261370930322f5d0134 /nova/service.py | |
parent | 57956569ff23adb5c1e1801d66c83424158f8580 (diff) | |
parent | 328185099087ae377d6dfcaec7538735e91a3bbc (diff) | |
download | nova-594689da5fa1187120d34969933e73d279164666.tar.gz nova-594689da5fa1187120d34969933e73d279164666.tar.xz nova-594689da5fa1187120d34969933e73d279164666.zip |
Merge "Ensure service's servicegroup API is created first."
Diffstat (limited to 'nova/service.py')
-rw-r--r-- | nova/service.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/nova/service.py b/nova/service.py index c5e2aa636..87857f93d 100644 --- a/nova/service.py +++ b/nova/service.py @@ -402,6 +402,14 @@ class Service(object): self.binary = binary self.topic = topic self.manager_class_name = manager + # NOTE(russellb) We want to make sure to create the servicegroup API + # instance early, before creating other things such as the manager, + # that will also create a servicegroup API instance. Internally, the + # servicegroup only allocates a single instance of the driver API and + # we want to make sure that our value of db_allowed is there when it + # gets created. For that to happen, this has to be the first instance + # of the servicegroup API. + self.servicegroup_api = servicegroup.API(db_allowed=db_allowed) manager_class = importutils.import_class(self.manager_class_name) self.manager = manager_class(host=self.host, *args, **kwargs) self.report_interval = report_interval @@ -411,10 +419,8 @@ class Service(object): self.saved_args, self.saved_kwargs = args, kwargs self.timers = [] self.backdoor_port = None - self.db_allowed = db_allowed self.conductor_api = conductor.API(use_local=db_allowed) self.conductor_api.wait_until_ready(context.get_admin_context()) - self.servicegroup_api = servicegroup.API(db_allowed=db_allowed) def start(self): verstr = version.version_string_with_package() |