Fix bugs in ACL

This commit is contained in:
Joshua Boniface 2019-12-29 16:31:32 -05:00
parent e55f2f0b92
commit 3e960b8adf
1 changed files with 3 additions and 3 deletions

View File

@ -459,7 +459,7 @@ def remove_acl(zk_conn, network, description):
match_description = '' match_description = ''
# Check if the ACL matches a description currently in the database # Check if the ACL matches a description currently in the database
acl_list = getNetworkACLs(zk_conn, net_vni, None) acl_list = getNetworkACLs(zk_conn, net_vni, 'both')
for acl in acl_list: for acl in acl_list:
if acl['description'] == description: if acl['description'] == description:
match_description = acl['description'] match_description = acl['description']
@ -475,11 +475,11 @@ def remove_acl(zk_conn, network, description):
return False, 'ERROR: Failed to write to Zookeeper! Exception: "{}".'.format(e) return False, 'ERROR: Failed to write to Zookeeper! Exception: "{}".'.format(e)
# Update the existing ordering # Update the existing ordering
updated_acl_list = getNetworkACLs(zk_conn, net_vni, direction) updated_acl_list = getNetworkACLs(zk_conn, net_vni, match_direction)
updated_orders = dict() updated_orders = dict()
for idx, acl in enumerate(updated_acl_list): for idx, acl in enumerate(updated_acl_list):
updated_orders[ updated_orders[
'/networks/{}/firewall_rules/{}/{}/order'.format(net_vni, direction, acl['description']) '/networks/{}/firewall_rules/{}/{}/order'.format(net_vni, match_direction, acl['description'])
] = idx ] = idx
if updated_orders: if updated_orders: