-
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?
Add config and show cli command for neigh-suppress #48
Conversation
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.
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| if vxlan_keys is not None: | ||
| for key in natsorted(vxlan_keys): | ||
| key1 = vxlan_table[key]['vlan'] | ||
| netdev = vxlan_keys[0][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 vxlan_keys[0][0] inside the loop may not correctly reflect the current key being processed. Consider using the current key variable (e.g., 'key') to construct netdev to avoid potential mismatches.
| netdev = vxlan_keys[0][0]+"-"+key1[4:] | |
| netdev = key[0]+"-"+key1[4:] |
| @click.argument('vid', metavar='<vid>', required=True, type=int) | ||
| @click.argument('state', metavar='<on|off>', required=True, type=click.Choice(["on", "off"])) | ||
| @clicommon.pass_db | ||
| def set_neigh_suppress(db, vid, state): |
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.
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.
| def set_neigh_suppress(db, vid, state): | |
| def set_neigh_suppress(db, vid, state): | |
| ctx = click.get_current_context() |
| body.append([vxlan_table[key]['vlan'], supp_str, netdev]) | ||
| click.echo(tabulate(body, header, tablefmt="grid")) | ||
| return | ||
| print(vlan + " is not configured in vxlan tunnel map table") |
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") |
Support ND suppress command.
What I did
How I did it
How to verify it
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)