Skip to content

Commit 2acfac7

Browse files
jlevequeyxieca
authored andcommitted
[caclmgrd] Don't crash if we find empty/null rule_props (#2475)
* [caclmgrd] Don't crash if we find empty/null rule_props
1 parent 993df17 commit 2acfac7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

files/image_config/caclmgrd/caclmgrd

+9-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,15 @@ class ControlPlaneAclManager(object):
183183

184184
for ((rule_table_name, rule_id), rule_props) in self._rules_db_info.iteritems():
185185
if rule_table_name == table_name:
186-
acl_rules[rule_props["PRIORITY"]] = rule_props
186+
if not rule_props:
187+
log_warning("rule_props for rule_id {} empty or null!".format(rule_id))
188+
continue
189+
190+
try:
191+
acl_rules[rule_props["PRIORITY"]] = rule_props
192+
except KeyError:
193+
log_error("rule_props for rule_id {} does not have key 'PRIORITY'!".format(rule_id))
194+
continue
187195

188196
# If we haven't determined the IP version for this ACL table yet,
189197
# try to do it now. We determine heuristically based on whether the

0 commit comments

Comments
 (0)