Merge "ovn: Filter ACL columns when syncing the DB"
This commit is contained in:
commit
0c851b2e61
@ -225,16 +225,14 @@ class OvnNbSynchronizer(OvnDbSynchronizer):
|
|||||||
|
|
||||||
def _get_acls_from_port_groups(self):
|
def _get_acls_from_port_groups(self):
|
||||||
ovn_acls = []
|
ovn_acls = []
|
||||||
port_groups = self.ovn_api.db_list_rows('Port_Group').execute()
|
acl_columns = (self.ovn_api._tables['ACL'].columns.keys() &
|
||||||
for pg in port_groups:
|
set(ovn_const.ACL_EXPECTED_COLUMNS_NBDB))
|
||||||
|
acl_columns.discard('external_ids')
|
||||||
|
for pg in self.ovn_api.db_list_rows('Port_Group').execute():
|
||||||
acls = getattr(pg, 'acls', [])
|
acls = getattr(pg, 'acls', [])
|
||||||
for acl in acls:
|
for acl in acls:
|
||||||
acl_string = {}
|
acl_string = {k: getattr(acl, k) for k in acl_columns}
|
||||||
acl_string['port_group'] = pg.name
|
acl_string['port_group'] = pg.name
|
||||||
for acl_key in getattr(acl, "_data", {}):
|
|
||||||
acl_string[acl_key] = getattr(acl, acl_key)
|
|
||||||
acl_string.pop('meter')
|
|
||||||
acl_string.pop('external_ids')
|
|
||||||
ovn_acls.append(acl_string)
|
ovn_acls.append(acl_string)
|
||||||
return ovn_acls
|
return ovn_acls
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user