Skip to content

Commit

Permalink
[caclmgrd] Don't crash if we find empty/null rule_props (sonic-net#2475)
Browse files Browse the repository at this point in the history
* [caclmgrd] Don't crash if we find empty/null rule_props
  • Loading branch information
jleveque authored and lguohan committed Jan 25, 2019
1 parent a18464b commit c82be49
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion files/image_config/caclmgrd/caclmgrd
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,15 @@ class ControlPlaneAclManager(object):

for ((rule_table_name, rule_id), rule_props) in self._rules_db_info.iteritems():
if rule_table_name == table_name:
acl_rules[rule_props["PRIORITY"]] = rule_props
if not rule_props:
log_warning("rule_props for rule_id {} empty or null!".format(rule_id))
continue

try:
acl_rules[rule_props["PRIORITY"]] = rule_props
except KeyError:
log_error("rule_props for rule_id {} does not have key 'PRIORITY'!".format(rule_id))
continue

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

0 comments on commit c82be49

Please sign in to comment.