Skip to content

Commit

Permalink
use state as key
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianrong Zhang committed Aug 3, 2021
1 parent 0ae67a0 commit b629ff8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/sonic-host-services/scripts/caclmgrd
Original file line number Diff line number Diff line change
Expand Up @@ -380,23 +380,23 @@ class ControlPlaneAclManager(daemon_base.DaemonBase):
self.log_info("Update DHCP chain: {}".format(update_cmd))

def update_dhcp_acl(self, key, op, data):
if "status" not in data:
if "state" not in data:
self.log_warning("Unexpected update in MUX_CABLE_TABLE")
return

intf = key
status = data["status"]
state = data["state"]

if status == "active":
if state == "active":
self.update_dhcp_chain("delete", intf)
elif status == "standby":
elif state == "standby":
self.update_dhcp_chain("insert", intf)
elif status == "unknown":
elif state == "unknown":
self.update_dhcp_chain("delete", intf)
elif status == "error":
self.log_warning("Cable status shows error")
elif state == "error":
self.log_warning("Cable state shows error")
else:
self.log_warning("Unexpected cable status")
self.log_warning("Unexpected cable state")

def get_acl_rules_and_translate_to_iptables_commands(self, namespace):
"""
Expand Down

0 comments on commit b629ff8

Please sign in to comment.