From 9511dc9864bdc1a68847d58c6e9f47bf98e9134b Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 13 Jun 2021 20:55:15 -0400 Subject: [PATCH] Correct issue with invalid ACL ordering --- daemon-common/network.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/daemon-common/network.py b/daemon-common/network.py index fc12ffe7..86adaaea 100644 --- a/daemon-common/network.py +++ b/daemon-common/network.py @@ -111,13 +111,20 @@ def getNetworkACLs(zkhandler, vni, _direction): full_acl_list = [] for direction in directions: unordered_acl_list = zkhandler.children((f'network.rules.{direction}', vni)) + if len(unordered_acl_list) < 1: + continue + ordered_acls = dict() for acl in unordered_acl_list: order = zkhandler.read((f'network.rule.{direction}', vni, 'rule.order', acl)) + if order is None: + continue ordered_acls[order] = acl for order in sorted(ordered_acls.keys()): rule = zkhandler.read((f'network.rule.{direction}', vni, 'rule.rule', acl)) + if rule is None: + continue full_acl_list.append({'direction': direction, 'order': int(order), 'description': ordered_acls[order], 'rule': rule}) return full_acl_list