From e3d6ba069a6ae858305f7f866d9d881ebb5af5ea Mon Sep 17 00:00:00 2001 From: Danny Allen Date: Thu, 16 Jul 2020 16:34:54 -0700 Subject: [PATCH] [acl_loader] Fix bugs in acl_loader (#991) - Support protocol number == 0 - Emit warning if --table_name not found in Config DB Signed-off-by: Danny Allen --- acl_loader/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/acl_loader/main.py b/acl_loader/main.py index c719100fd968..f23aefc2e4be 100644 --- a/acl_loader/main.py +++ b/acl_loader/main.py @@ -244,6 +244,9 @@ def set_table_name(self, table_name): :param table_name: Table name :return: """ + if not self.is_table_valid(table_name): + warning("Table \"%s\" not found" % table_name) + self.current_table = table_name def set_session_name(self, session_name): @@ -412,7 +415,7 @@ def convert_l2(self, table_name, rule_idx, rule): def convert_ip(self, table_name, rule_idx, rule): rule_props = {} - if rule.ip.config.protocol: + if rule.ip.config.protocol or rule.ip.config.protocol == 0: # 0 is a valid protocol number if self.ip_protocol_map.has_key(rule.ip.config.protocol): rule_props["IP_PROTOCOL"] = self.ip_protocol_map[rule.ip.config.protocol] else: