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

[sfp] Fix issue: Application Advertisement is not well formatted

Open Junchao-Mellanox opened this issue 3 years ago • 5 comments

What I did

Currently, the value of "Application Advertisement" is a python dict to string which is not well formatted. This PR re-format the output of "Application Advertisement" to a human readable string

How I did it

Set the output to similar to 202012

How to verify it

Unit test Manual test

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

Ethernet200: SFP EEPROM detected
        Application Advertisement: {1: {'host_electrical_interface_id': '400GAUI-8 C2M (Annex 120E)', 'module_media_interface_id': '400GBASE-DR4 (Cl 124)', 'media_lane_count': 4, 'host_lane_count': 8, 'host_lane_assignment_options': 1}, 2: {'host_electrical_interface_id': '100GAUI-2 C2M (Annex 135G)', 'module_media_interface_id': '100GBASE-DR (Cl 140)', 'media_lane_count': 1, 'host_lane_count': 2, 'host_lane_assignment_options': 85}}

...

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

Ethernet200: SFP EEPROM detected
        Application Advertisement: 400GAUI-8 C2M (Annex 120E) - 400GBASE-DR4 (Cl 124) - 0x1
                                   100GAUI-2 C2M (Annex 135G) - 100GBASE-DR (Cl 140) - 0x55
...

Junchao-Mellanox avatar Nov 10 '22 06:11 Junchao-Mellanox

LGTM beside of the comment which is more like a question than a suggestion

liat-grozovik avatar Nov 10 '22 12:11 liat-grozovik

/azp run Azure.sonic-utilities

liat-grozovik avatar Nov 10 '22 12:11 liat-grozovik

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Nov 10 '22 12:11 azure-pipelines[bot]

@Junchao-Mellanox can you add lane assignment mask also in hex?

prgeor avatar Nov 10 '22 22:11 prgeor

This pull request introduces 2 alerts when merging 52d6c81f918ee2f3f53190eb1f4f1e7a6d17bc23 into a5eb26b682c42b5cf0716dc98b72be4feb81b333 - view on LGTM.com

new alerts:

  • 2 for Variable defined multiple times

lgtm-com[bot] avatar Nov 11 '22 01:11 lgtm-com[bot]

Hi prgeor, would you please review again?

Junchao-Mellanox avatar Nov 14 '22 01:11 Junchao-Mellanox

@Junchao-Mellanox can you check the build failure

prgeor avatar Nov 17 '22 16:11 prgeor

/azpw run Azure.sonic-utilities

Junchao-Mellanox avatar Nov 18 '22 00:11 Junchao-Mellanox

/AzurePipelines run Azure.sonic-utilities

mssonicbld avatar Nov 18 '22 00:11 mssonicbld

LGTM check is stuck. Will override.

qiluo-msft avatar Nov 19 '22 04:11 qiluo-msft

Hi @yxieca , could you please help cherry-pick to 202205?

Junchao-Mellanox avatar Nov 20 '22 13:11 Junchao-Mellanox