Locking when initializing the NSGroupManager and the default FW section

Change-Id: If15657fb74ab4e794021e358046451bc96978724
This commit is contained in:
Roey Chen 2015-12-27 07:57:05 -08:00
parent b973e406f9
commit 5bd5a4c731
2 changed files with 5 additions and 3 deletions

View File

@ -207,8 +207,6 @@ def update_lport_with_security_groups(context, lport_id, original, updated):
def init_nsgroup_manager_and_default_section_rules():
# REVISIT(roeyc): Should handle Neutron active-active
# deployment scenario.
section_description = ("This section is handled by OpenStack to contain "
"default rules on security-groups.")

View File

@ -128,7 +128,7 @@ class NsxV3Plugin(addr_pair_db.AllowedAddressPairsMixin,
self._port_client = nsx_resources.LogicalPort(self._nsx_client)
self.nsgroup_manager, self.default_section = (
security.init_nsgroup_manager_and_default_section_rules())
self._init_nsgroup_manager_and_default_section_rules())
self._router_client = nsx_resources.LogicalRouter(self._nsx_client)
self._router_port_client = nsx_resources.LogicalRouterPort(
self._nsx_client)
@ -227,6 +227,10 @@ class NsxV3Plugin(addr_pair_db.AllowedAddressPairsMixin,
tags=utils.build_v3_api_version_tag())
return self._get_port_security_profile()
def _init_nsgroup_manager_and_default_section_rules(self):
with locking.LockManager.get_lock('nsxv3_nsgroup_manager_init'):
return security.init_nsgroup_manager_and_default_section_rules()
def _setup_rpc(self):
self.endpoints = [dhcp_rpc.DhcpRpcCallback(),
agents_db.AgentExtRpcCallback(),