Skip to content

Commit

Permalink
[aclshow]: Fix crash when no rules in ACL table (sonic-net#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shuotian Cheng authored Jun 21, 2017
1 parent 0ad5280 commit a6734d4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/aclshow
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,11 @@ class AclStat(object):
"""
for table_name in self.acl_tables.keys():
rules = self.db.keys(self.db.APPL_DB, "ACL_RULE_TABLE:%s:*" % table_name)
if not rules and verboseflag:
print("No ACL rules found")
if not rules:
if verboseflag:
print("No ACL rules found in %s" % table_name)
continue

if verboseflag:
rules_cnt = len(rules)
print("ACL Rules found in %s:" % table_name, rules_cnt)
Expand Down

0 comments on commit a6734d4

Please sign in to comment.