[nsx_v3] Register security group resources at startup

This will avoid an error from the quota manager while trying
to create security group rules for the default security group.

Change-Id: I85a46931a96f90a084af10e85f9155c8ed850195
This commit is contained in:
Salvatore Orlando 2021-04-07 00:52:48 -07:00 committed by Salvatore Orlando
parent f2ee661e22
commit 182cfc2524
1 changed files with 5 additions and 0 deletions

View File

@ -172,6 +172,11 @@ class NsxV3Plugin(nsx_plugin_common.NsxPluginV3Base,
router=l3_db_models.Router,
floatingip=l3_db_models.FloatingIP)
def __init__(self):
# Register these resources before the relevant extensiosn are loaded
# to prevent failures due to QuotaResourceUnknown error while creating
# default security group
resource_registry.register_resource_by_name('security_group')
resource_registry.register_resource_by_name('security_group_rule')
self.fwaas_callbacks = None
self._is_sub_plugin = tvd_utils.is_tvd_core_plugin()
self.init_is_complete = False