Skip to content

Conversation

@RayWang910012
Copy link

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)

Copy link

Copilot AI left a 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:]
Copy link

Copilot AI Apr 15, 2025

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.

Suggested change
netdev = vxlan_keys[0][0]+"-"+key1[4:]
netdev = key[0]+"-"+key1[4:]

Copilot uses AI. Check for mistakes.
@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):
Copy link

Copilot AI Apr 15, 2025

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.

Suggested change
def set_neigh_suppress(db, vid, state):
def set_neigh_suppress(db, vid, state):
ctx = click.get_current_context()

Copilot uses AI. Check for mistakes.
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")
Copy link

Copilot AI Apr 15, 2025

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.

Suggested change
print(vlan + " is not configured in vxlan tunnel map table")
click.echo(vlan + " is not configured in vxlan tunnel map table")

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant