sonic-utilities icon indicating copy to clipboard operation
sonic-utilities copied to clipboard

Fixes invalid namespace issues that would occur when making sfputil C…

Open bmridul opened this issue 3 years ago • 5 comments

What I did

Fixed invalid namespace issues that would occur when making sfputil CLI calls.

How I did it

Made a call to load_db_config() in load_port_config()

How to verify it

sfputil show presence

Previous command output (if the output of a command-line utility has changed)

root@sonic:/home/cisco# sfputil show presence
Error reading port info (:- validateNamespace: Initialize global DB config using API SonicDBConfig::initializeGlobalConfig)

New command output (if the output of a command-line utility has changed)

root@sonic:/home/cisco# sfputil show presence
Port        Presence
----------  -----------
Ethernet18  Not present
Ethernet38  Not present
Ethernet45  Not present
Ethernet41  Not present
Ethernet44  Not present
Ethernet47  Not present
Ethernet28  Not present
Ethernet36  Not present
Ethernet7   Present
Ethernet19  Not present
Ethernet16  Not present
Ethernet25  Not present
Ethernet29  Not present
Ethernet43  Not present
Ethernet32  Not present
Ethernet33  Not present
Ethernet11  Not present
Ethernet2   Not present
Ethernet10  Not present
Ethernet6   Present
Ethernet22  Not present
Ethernet42  Not present
Ethernet37  Not present
Ethernet5   Present
Ethernet30  Not present
Ethernet9   Not present
Ethernet14  Not present
Ethernet26  Not present
Ethernet46  Not present
Ethernet31  Not present
Ethernet35  Not present
Ethernet17  Not present
Ethernet4   Not present
Ethernet8   Present
Ethernet1   Not present
Ethernet20  Not present
Ethernet24  Not present
Ethernet23  Not present
Ethernet27  Not present
Ethernet40  Not present
Ethernet3   Not present
Ethernet12  Not present
Ethernet21  Not present
Ethernet0   Present
Ethernet39  Not present
Ethernet34  Not present
Ethernet13  Not present
Ethernet15  Not present

bmridul avatar Aug 17 '22 22:08 bmridul

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: bmridul / name: Mridul Bajpai (cfdbf82b98c4da4adbfd655d0f66fcd9a04a1301)

@abdosi @rlhui Pls assign someone to review.

bmridul avatar Sep 12 '22 21:09 bmridul

@mlok-nokia can you please help review this

abdosi avatar Sep 26 '22 19:09 abdosi

@mlok-nokia can you please help review this This is the similar to the issue which I have created the PR for. But My PR only addresses "sfputil show error-status", Not address "sfputil show presence". Review is done https://github.com/sonic-net/sonic-utilities/pull/2373

mlok-nokia avatar Sep 26 '22 23:09 mlok-nokia

@abdosi The reason why I separated the "sudo sfputil show presence/eeprom" and "sudo sfputil show error-status" is: There is no problem with ""sudo sfputil show presence/eeprom"" command on msft-2205 branch, this two command only occurs on Master branch. The msft-2205 branch only has the "sudo sfputil show error-status" issue.

mlok-nokia avatar Sep 27 '22 15:09 mlok-nokia