def get_acls(self, context):
"""create the list of ACLS in OVN.
@param context: neutron context
@type context: object of type neutron.context.Context
@var lswitch_names: List of lswitch names
@var acl_list: List of NB acls
@var acl_list_dict: Dictionary of acl-lists based on lport as key
@return: acl_list-dict
"""
lswitch_names = set([])
for network in self.core_plugin.get_networks(context):
lswitch_names.add(network['id'])
acl_dict, ignore1, ignore2 = \
self.ovn_api.get_acls_for_lswitches(lswitch_names)
acl_list = list(itertools.chain(*six.itervalues(acl_dict)))
acl_list_dict = {}
for acl in acl_list:
key = acl['lport']
if key in acl_list_dict:
acl_list_dict[key].append(acl)
else:
acl_list_dict[key] = list([acl])
return acl_list_dict
评论列表
文章目录