Skip to content
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

[VXLAN]Fixing traceback in show remotemac when mac moves during command execution #2506

Merged
merged 3 commits into from
Nov 22, 2022

Conversation

dgsudharsan
Copy link
Collaborator

What I did

During the execution of show vxlan remotemac command, if a mac moves after the key is fetched but not the table fields, there will be the below traceback

show vxlan remotemac 2.2.2.2 
Traceback (most recent call last):
  File "/usr/local/bin/show", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/show/vxlan.py", line 310, in remotemac
    rmtip = vxlan_table['remote_vtep']
KeyError: 'remote_vtep'

This is because the entry would have got removed before the CLI fetches the table.

How I did it

Used get API to fetch table rather than indexing directly which resulted in traceback. Additionally fixed Python 3.8 SyntaxWarning.

show vxlan remotemac all
/usr/local/lib/python3.9/dist-packages/show/vxlan.py:101: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if vtep_sip is not '0.0.0.0':
/usr/local/lib/python3.9/dist-packages/show/vxlan.py:108: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if vtep_sip is not '0.0.0.0':

How to verify it

Perform mac move during show command execution and verify there is no traceback.

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)

@lgtm-com
Copy link

lgtm-com bot commented Nov 17, 2022

This pull request introduces 1 alert when merging 01796d2 into c497c84 - view on LGTM.com

new alerts:

  • 1 for Testing equality to None

Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine ⚙️ that powers LGTM.com. For more information, please check out our post on the GitHub blog.

@lgtm-com
Copy link

lgtm-com bot commented Nov 17, 2022

This pull request introduces 1 alert when merging 5be7c2c into c497c84 - view on LGTM.com

new alerts:

  • 1 for Testing equality to None

Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine ⚙️ that powers LGTM.com. For more information, please check out our post on the GitHub blog.

@liat-grozovik liat-grozovik merged commit 2af8cfa into sonic-net:master Nov 22, 2022
mdanish-kh pushed a commit to mdanish-kh/sonic-utilities that referenced this pull request Nov 23, 2022
…nd execution (sonic-net#2506)

- What I did
During the execution of show vxlan remotemac command, if a mac moves after the key is fetched but not the table fields, there will be the below traceback

show vxlan remotemac 2.2.2.2 
This is because the entry would have got removed before the CLI fetches the table.

- How I did it
Used get API to fetch table rather than indexing directly which resulted in traceback. Additionally fixed Python 3.8 SyntaxWarning.

show vxlan remotemac all
/usr/local/lib/python3.9/dist-packages/show/vxlan.py:101: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if vtep_sip is not '0.0.0.0':
/usr/local/lib/python3.9/dist-packages/show/vxlan.py:108: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if vtep_sip is not '0.0.0.0':

- How to verify it
Perform mac move during show command execution and verify there is no traceback.
yxieca pushed a commit that referenced this pull request Nov 29, 2022
…nd execution (#2506)

- What I did
During the execution of show vxlan remotemac command, if a mac moves after the key is fetched but not the table fields, there will be the below traceback

show vxlan remotemac 2.2.2.2 
This is because the entry would have got removed before the CLI fetches the table.

- How I did it
Used get API to fetch table rather than indexing directly which resulted in traceback. Additionally fixed Python 3.8 SyntaxWarning.

show vxlan remotemac all
/usr/local/lib/python3.9/dist-packages/show/vxlan.py:101: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if vtep_sip is not '0.0.0.0':
/usr/local/lib/python3.9/dist-packages/show/vxlan.py:108: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if vtep_sip is not '0.0.0.0':

- How to verify it
Perform mac move during show command execution and verify there is no traceback.
preetham-singh pushed a commit to preetham-singh/sonic-utilities that referenced this pull request Dec 6, 2022
…nd execution (sonic-net#2506)

- What I did
During the execution of show vxlan remotemac command, if a mac moves after the key is fetched but not the table fields, there will be the below traceback

show vxlan remotemac 2.2.2.2 
This is because the entry would have got removed before the CLI fetches the table.

- How I did it
Used get API to fetch table rather than indexing directly which resulted in traceback. Additionally fixed Python 3.8 SyntaxWarning.

show vxlan remotemac all
/usr/local/lib/python3.9/dist-packages/show/vxlan.py:101: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if vtep_sip is not '0.0.0.0':
/usr/local/lib/python3.9/dist-packages/show/vxlan.py:108: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if vtep_sip is not '0.0.0.0':

- How to verify it
Perform mac move during show command execution and verify there is no traceback.
dprital added a commit to dprital/sonic-buildimage that referenced this pull request Dec 6, 2022
Update sonic-utilities submodule pointer to include the following:
* ca9a020 [generate_dump] [Mellanox] Fix the duplicate dfw dump collection problem by adding symlinks ([sonic-net#2536](sonic-net/sonic-utilities#2536))
* 92c7001 [config] Add check in config interface ip command to block if the interface is portchannel member ([sonic-net#2539](sonic-net/sonic-utilities#2539))
* e8130f5 [system-health] Improve code structure of system health CLIs ([sonic-net#2453](sonic-net/sonic-utilities#2453))
* 00c01b3 Transceiver eeprom dom CLI modification to show output from TRANSCEIVER_DOM_THRESHOLD table ([sonic-net#2535](sonic-net/sonic-utilities#2535))
* 42f51c2 sonic-utilities: Update config reload() to verify formatting of an input file ([sonic-net#2529](sonic-net/sonic-utilities#2529))
* a5e1e2b [GCU] Add RemoveCreateOnlyDependency Validator/Generator ([sonic-net#2500](sonic-net/sonic-utilities#2500))
* 6411b52 [QoS] Introduce delay to the qos reload flow ([sonic-net#2503](sonic-net/sonic-utilities#2503))
* fce7ec3 Use github code scanning instead of LGTM ([sonic-net#2530](sonic-net/sonic-utilities#2530))
* 91bd6de Change show kube command default value of insecure key to True ([sonic-net#2517](sonic-net/sonic-utilities#2517))
* c44c584 Add db_migrator_constants.py script to setup.py ([sonic-net#2534](sonic-net/sonic-utilities#2534))
* 6a3238e [drop counters] Fix CLI script for unconfigured PGs ([sonic-net#2518](sonic-net/sonic-utilities#2518))
* 263810b Update vrf add, del commands for duplicate/non-existing VRFs ([sonic-net#2467](sonic-net/sonic-utilities#2467))
* addae73 Port 202012 DB migration changes to newer branches ([sonic-net#2515](sonic-net/sonic-utilities#2515))
* 2af8cfa [VXLAN]Fixing traceback in show remotemac when mac moves during command execution ([sonic-net#2506](sonic-net/sonic-utilities#2506))

Signed-off-by: dprital <[email protected]>
StormLiangMS pushed a commit that referenced this pull request Dec 30, 2022
…nd execution (#2506)

- What I did
During the execution of show vxlan remotemac command, if a mac moves after the key is fetched but not the table fields, there will be the below traceback

show vxlan remotemac 2.2.2.2 
This is because the entry would have got removed before the CLI fetches the table.

- How I did it
Used get API to fetch table rather than indexing directly which resulted in traceback. Additionally fixed Python 3.8 SyntaxWarning.

show vxlan remotemac all
/usr/local/lib/python3.9/dist-packages/show/vxlan.py:101: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if vtep_sip is not '0.0.0.0':
/usr/local/lib/python3.9/dist-packages/show/vxlan.py:108: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if vtep_sip is not '0.0.0.0':

- How to verify it
Perform mac move during show command execution and verify there is no traceback.
@dgsudharsan dgsudharsan deleted the vxlan_fix branch March 9, 2023 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants