Merge "TVD: move plugins init_complete code to the end of init"

This commit is contained in:
Zuul 2018-01-12 13:28:42 +00:00 committed by Gerrit Code Review
commit 36250d8af8
2 changed files with 14 additions and 9 deletions
vmware_nsx/plugins

@ -223,6 +223,7 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
floatingip=l3_db_models.FloatingIP)
def __init__(self):
self._is_sub_plugin = tvd_utils.is_tvd_core_plugin()
self.init_is_complete = False
self.housekeeper = None
super(NsxVPluginV2, self).__init__()
if self._is_sub_plugin:
@ -233,10 +234,6 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
extension_drivers=extension_drivers)
# Bind the dummy L3 notifications
self.l3_rpc_notifier = l3_rpc_agent_api.L3NotifyAPI()
self.init_is_complete = False
registry.subscribe(self.init_complete,
resources.PROCESS,
events.AFTER_INIT)
self._extension_manager.initialize()
self.supported_extension_aliases.extend(
self._extension_manager.extension_aliases())
@ -323,6 +320,12 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
# Bind QoS notifications
qos_driver.register(self)
# subscribe the init complete method last, so it will be called only
# if init was successful
registry.subscribe(self.init_complete,
resources.PROCESS,
events.AFTER_INIT)
@staticmethod
def plugin_type():
return projectpluginmap.NsxPlugins.NSX_V

@ -214,6 +214,7 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
floatingip=l3_db_models.FloatingIP)
def __init__(self):
self._is_sub_plugin = tvd_utils.is_tvd_core_plugin()
self.init_is_complete = False
nsxlib_utils.set_is_attr_callback(validators.is_attr_set)
self._extend_fault_map()
if self._is_sub_plugin:
@ -271,11 +272,6 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
# init profiles on nsx backend
self._init_nsx_profiles()
self.init_is_complete = False
registry.subscribe(self.init_complete,
resources.PROCESS,
events.AFTER_INIT)
# Include exclude NSGroup
LOG.debug("Initializing NSX v3 Excluded Port NSGroup")
self._excluded_port_nsgroup = None
@ -307,6 +303,12 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
# Register NSXv3 trunk driver to support trunk extensions
self.trunk_driver = trunk_driver.NsxV3TrunkDriver.create(self)
# subscribe the init complete method last, so it will be called only
# if init was successful
registry.subscribe(self.init_complete,
resources.PROCESS,
events.AFTER_INIT)
@staticmethod
def plugin_type():
return projectpluginmap.NsxPlugins.NSX_T