Skip to content

Commit 7744c8d

Browse files
authored
[fdb]cli: fdb entries are cleared according to vlan or port or vlan&&port (sonic-net#657)
Fdb entries can be deleted with user specifying vlan or port or vlan&&port.
1 parent e23c5ee commit 7744c8d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

scripts/fdbclear

100644100755
+8-3
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,15 @@ def main():
4242

4343
try:
4444
fdb = FdbClear()
45-
if args.vlan is not None:
46-
print("command not supported yet.")
45+
if args.vlan is not None and args.port is not None:
46+
fdb.send_notification("PORTVLAN", args.port+'|'+args.vlan)
47+
print("Port {} + Vlan{} FDB entries are cleared.".format(args.port, args.vlan))
48+
elif args.vlan is not None:
49+
fdb.send_notification("VLAN", args.vlan)
50+
print("Vlan{} FDB entries are cleared.".format(args.vlan))
4751
elif args.port is not None:
48-
print("command not supported yet.")
52+
fdb.send_notification("PORT", args.port)
53+
print("Port {} FDB entries are cleared.".format(args.port))
4954
else:
5055
fdb.send_notification("ALL", "ALL")
5156
print("FDB entries are cleared.")

0 commit comments

Comments
 (0)