-
Notifications
You must be signed in to change notification settings - Fork 25
Add config and show cli command for neigh-suppress #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 202311.X
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -178,3 +178,59 @@ def tablelize(keys, data): | |||||
| header = ['Name', 'VID', 'Member', 'Mode'] | ||||||
| click.echo(tabulate(tablelize(keys, data), header)) | ||||||
|
|
||||||
| #Neigh Suppress | ||||||
| @click.group(cls=clicommon.AliasedGroup) | ||||||
| def neigh_suppress(): | ||||||
| """ show neigh-suppress """ | ||||||
| pass | ||||||
| @neigh_suppress.command('all') | ||||||
| @clicommon.pass_db | ||||||
| def neigh_suppress_all(db): | ||||||
| """ Show neigh-suppress all """ | ||||||
|
|
||||||
| header = ['VLAN', 'STATUS', 'ASSOCIATED_NETDEV'] | ||||||
| body = [] | ||||||
|
|
||||||
| vxlan_table = db.cfgdb.get_table('VXLAN_TUNNEL_MAP') | ||||||
| suppress_table = db.cfgdb.get_table('SUPPRESS_VLAN_NEIGH') | ||||||
| vxlan_keys = vxlan_table.keys() | ||||||
| num=0 | ||||||
| if vxlan_keys is not None: | ||||||
| for key in natsorted(vxlan_keys): | ||||||
| key1 = vxlan_table[key]['vlan'] | ||||||
| netdev = vxlan_keys[0][0]+"-"+key1[4:] | ||||||
|
||||||
| netdev = vxlan_keys[0][0]+"-"+key1[4:] | |
| netdev = key[0]+"-"+key1[4:] |
Copilot
AI
Apr 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using print here is inconsistent with the rest of the CLI output which uses click.echo. Consider replacing print with click.echo to maintain a consistent output format.
| print(vlan + " is not configured in vxlan tunnel map table") | |
| click.echo(vlan + " is not configured in vxlan tunnel map table") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable 'ctx' is used but not defined in this function. Pass the click context via a parameter or use appropriate error reporting like click.echo before exiting.