Skip to content

Commit

Permalink
[fdb]cli: fdb entries are cleared according to vlan or port or vlan&&…
Browse files Browse the repository at this point in the history
…port (sonic-net#657)

Fdb entries can be deleted with user specifying vlan or port or vlan&&port.
  • Loading branch information
yangshp1987 committed May 24, 2021
1 parent e23c5ee commit 7744c8d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/fdbclear
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ def main():

try:
fdb = FdbClear()
if args.vlan is not None:
print("command not supported yet.")
if args.vlan is not None and args.port is not None:
fdb.send_notification("PORTVLAN", args.port+'|'+args.vlan)
print("Port {} + Vlan{} FDB entries are cleared.".format(args.port, args.vlan))
elif args.vlan is not None:
fdb.send_notification("VLAN", args.vlan)
print("Vlan{} FDB entries are cleared.".format(args.vlan))
elif args.port is not None:
print("command not supported yet.")
fdb.send_notification("PORT", args.port)
print("Port {} FDB entries are cleared.".format(args.port))
else:
fdb.send_notification("ALL", "ALL")
print("FDB entries are cleared.")
Expand Down

0 comments on commit 7744c8d

Please sign in to comment.