NSX|V complete init of fwaas core plugin
The FWaaS driver uses the core plugin. In some cases the init-complete callback was not yet issued for this plugin and should be called manually. Change-Id: Id64d7242e8aa7595a73d0af22fd44bf1119cb2a7
This commit is contained in:
parent
fc60d37c7d
commit
2ddeba6ea4
@ -304,22 +304,27 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
||||
qos_driver.register(self)
|
||||
|
||||
def init_complete(self, resource, event, trigger, **kwargs):
|
||||
has_metadata_cfg = (
|
||||
cfg.CONF.nsxv.nova_metadata_ips
|
||||
and cfg.CONF.nsxv.mgt_net_moid
|
||||
and cfg.CONF.nsxv.mgt_net_proxy_ips
|
||||
and cfg.CONF.nsxv.mgt_net_proxy_netmask)
|
||||
if has_metadata_cfg:
|
||||
# Init md_proxy handler per availability zone
|
||||
self.metadata_proxy_handler = {}
|
||||
for az in self.get_azs_list():
|
||||
# create metadata handler only if the az supports it.
|
||||
# if not, the global one will be used
|
||||
if az.supports_metadata():
|
||||
self.metadata_proxy_handler[az.name] = (
|
||||
nsx_v_md_proxy.NsxVMetadataProxyHandler(self, az))
|
||||
with locking.LockManager.get_lock('plugin-init-complete'):
|
||||
if self.init_is_complete:
|
||||
# Should be called only once per worker
|
||||
return
|
||||
has_metadata_cfg = (
|
||||
cfg.CONF.nsxv.nova_metadata_ips
|
||||
and cfg.CONF.nsxv.mgt_net_moid
|
||||
and cfg.CONF.nsxv.mgt_net_proxy_ips
|
||||
and cfg.CONF.nsxv.mgt_net_proxy_netmask)
|
||||
if has_metadata_cfg:
|
||||
# Init md_proxy handler per availability zone
|
||||
self.metadata_proxy_handler = {}
|
||||
for az in self.get_azs_list():
|
||||
# create metadata handler only if the az supports it.
|
||||
# if not, the global one will be used
|
||||
if az.supports_metadata():
|
||||
self.metadata_proxy_handler[az.name] = (
|
||||
nsx_v_md_proxy.NsxVMetadataProxyHandler(
|
||||
self, az))
|
||||
|
||||
self.init_is_complete = True
|
||||
self.init_is_complete = True
|
||||
|
||||
def _validate_nsx_version(self):
|
||||
ver = self.nsx_v.vcns.get_version()
|
||||
|
@ -34,7 +34,11 @@ class EdgeFwaasDriver(fwaas_base.FwaasDriverBase):
|
||||
|
||||
@property
|
||||
def core_plugin(self):
|
||||
return directory.get_plugin()
|
||||
if not self._core_plugin:
|
||||
self._core_plugin = directory.get_plugin()
|
||||
if not self._core_plugin.init_is_complete:
|
||||
self._core_plugin.init_complete(None, None, {})
|
||||
return self._core_plugin
|
||||
|
||||
@property
|
||||
def edge_manager(self):
|
||||
@ -44,6 +48,7 @@ class EdgeFwaasDriver(fwaas_base.FwaasDriverBase):
|
||||
LOG.debug("Loading FWaaS NsxVDriver.")
|
||||
super(EdgeFwaasDriver, self).__init__()
|
||||
self.driver_name = FWAAS_DRIVER_NAME
|
||||
self._core_plugin = None
|
||||
|
||||
def should_apply_firewall_to_router(self, router_data,
|
||||
raise_exception=True):
|
||||
|
Loading…
x
Reference in New Issue
Block a user