diff --git a/acl_loader/main.py b/acl_loader/main.py index 6311e55fa2..dedaf0eb3e 100644 --- a/acl_loader/main.py +++ b/acl_loader/main.py @@ -759,7 +759,7 @@ def incremental_update(self): namespace_configdb.mod_entry(self.ACL_RULE, key, None) for key in existing_controlplane_rules: - if operator.eq(self.rules_info[key], self.rules_db_info[key]) == False: + if not operator.eq(self.rules_info[key], self.rules_db_info[key]): self.configdb.set_entry(self.ACL_RULE, key, self.rules_info[key]) # Program for per-asic namespace corresponding to front asic also if present. # For control plane ACL it's not needed but to keep all db in sync program everywhere diff --git a/tests/acl_input/incremental_1.json b/tests/acl_input/incremental_1.json new file mode 100644 index 0000000000..57ede08bf7 --- /dev/null +++ b/tests/acl_input/incremental_1.json @@ -0,0 +1,32 @@ +{ + "acl": { + "acl-sets": { + "acl-set": { + "ntp-acl": { + "acl-entries": { + "acl-entry": { + "1": { + "ip": { + "config": { + "source-ip-address": "20.0.0.12/32" + } + }, + "config": { + "sequence-id": 1 + }, + "actions": { + "config": { + "forwarding-action": "ACCEPT" + } + } + } + } + }, + "config": { + "name": "ntp-acl" + } + } + } + } + } +} \ No newline at end of file diff --git a/tests/acl_input/incremental_2.json b/tests/acl_input/incremental_2.json new file mode 100644 index 0000000000..b7de6edbac --- /dev/null +++ b/tests/acl_input/incremental_2.json @@ -0,0 +1,32 @@ +{ + "acl": { + "acl-sets": { + "acl-set": { + "ntp-acl": { + "acl-entries": { + "acl-entry": { + "1": { + "ip": { + "config": { + "source-ip-address": "20.0.0.12/32" + } + }, + "config": { + "sequence-id": 1 + }, + "actions": { + "config": { + "forwarding-action": "DROP" + } + } + } + } + }, + "config": { + "name": "ntp-acl" + } + } + } + } + } +} \ No newline at end of file