Skip to content

Commit

Permalink
Validate acl.json after parsing (sonic-net#320)
Browse files Browse the repository at this point in the history
Signed-off-by: Qi Luo <[email protected]>
  • Loading branch information
qiluo-msft authored and lguohan committed Sep 14, 2018
1 parent cba11a0 commit 1e0f2ff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions acl_loader/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ def load_rules_from_file(self, filename):
:return:
"""
self.yang_acl = pybindJSON.load(filename, openconfig_acl, "openconfig_acl")
if pybindJSON.dumps(self.yang_acl) == '{}':
raise AclLoaderException("Invalid input file %s" % filename)
self.convert_rules()

def convert_action(self, table_name, rule_idx, rule):
Expand Down

0 comments on commit 1e0f2ff

Please sign in to comment.