Skip to content

Conversation

@ade-d
Copy link

@ade-d ade-d commented Oct 9, 2020

- What I did
Added CLI which summarizes the info for media based on new parser
Parser PR is sonic-net/sonic-platform-common#129

- How I did it
Extended CLICK

- How to verify it
Visually verified it against expected values

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

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

root@sonic:~# show interfaces  transceiver  summary


Interface    Media Name                           Max Power(W)    Vendor Name    Serial Num.      Part Num.    QSA Adapter    Qualified
-----------  -----------------------------------  --------------  -------------  ---------------  -----------  -------------  -----------
Ethernet0    QSFP56-DD 400GBASE-SR8-AOC-10.0M     12.0            DELL EMC       TW0LXT00058000G  9GMDY        N/A            N/A
Ethernet8    QSFP56-DD 400GBASE-SR8-AOC-10.0M     12.0            DELL EMC       TW0LXT00058000G  9GMDY        N/A            N/A
Ethernet16   QSFP56-DD 400GBASE-SR8-AOC-10.0M     12.0            DELL EMC       TW0LXT000580008  9GMDY        N/A            N/A
Ethernet24   QSFP56-DD 400GBASE-SR8-AOC-10.0M     12.0            DELL EMC       TW0LXT000580008  9GMDY        N/A            N/A
Ethernet32   QSFP56-DD 4x(100GBASE-SR0-ACC)-5.0M  10.0            DELL EMC       CN0F9KR705D0001  C0TP5        N/A            N/A
Ethernet40   QSFP56-DD 4x(100GBASE-SR0-ACC)-3.0M  10.0            DELL EMC       CN0F9KR705E0003  0WDNV        N/A            N/A
Ethernet48   QSFP28 100GBASE-SR4-ACC-5.0M         4.0             DELL EMC       CN0F9KR705D0001  C0TP5        N/A            N/A
Ethernet56   QSFP28 100GBASE-SR4-ACC-5.0M         4.0             DELL EMC       CN0F9KR705D0001  C0TP5        N/A            N/A
Ethernet64   QSFP28 100GBASE-SR4-ACC-5.0M         4.0             DELL EMC       CN0F9KR705D0001  C0TP5        N/A            N/A
Ethernet72   QSFP28 100GBASE-SR4-ACC-5.0M         4.0             DELL EMC       CN0F9KR705D0001  C0TP5        N/A            N/A
Ethernet80   QSFP28 100GBASE-SR4-ACC-3.0M         4.0             DELL EMC       CN0F9KR705E0003  0WDNV        N/A            N/A
Ethernet88   QSFP28 100GBASE-SR4-ACC-3.0M         4.0             DELL EMC       CN0F9KR705E0003  0WDNV        N/A            N/A
Ethernet96   QSFP28 100GBASE-SR4-ACC-3.0M         4.0             DELL EMC       CN0F9KR705E0003  0WDNV        N/A            N/A
Ethernet104  QSFP28 100GBASE-SR4-ACC-3.0M         4.0             DELL EMC       CN0F9KR705E0003  0WDNV        N/A            N/A
Ethernet112  QSFP28 4x(25GBASE-CR-DAC)-3.0M       1.5             DELL           CN07720685Q1MJ7  7R9N9        N/A            N/A
Ethernet120  SFP28 25GBASE-CR-DAC-3.0M            2.5             DELL           CN07720685Q1MJ7  7R9N9        N/A            N/A
Ethernet128  N/A                                  N/A             N/A            N/A              N/A          N/A            N/A
Ethernet136  N/A                                  N/A             N/A            N/A              N/A          N/A            N/A
Ethernet144  N/A                                  N/A             N/A            N/A              N/A          N/A            N/A
Ethernet152  N/A                                  N/A             N/A            N/A              N/A          N/A            N/A
Ethernet160  QSFP28 100GBASE-CWDM4                3.5             DELL           CN04HG008BL0001  THPF3        N/A            N/A
Ethernet168  QSFP28 100GBASE-CWDM4                3.5             DELL           MY01360289T008Z  THPF3        N/A            N/A
Ethernet176  QSFP28 100GBASE-SWDM4                3.5             DELL           MY01360298V00Q3  X7CCC        N/A            N/A
Ethernet184  N/A                                  N/A             N/A            N/A              N/A          N/A            N/A
Ethernet192  QSFP28 100GBASE-SR4                  3.5             DELL           CN079192823000M  YKMH7        N/A            N/A
Ethernet200  QSFP28 100GBASE-SR4                  3.5             DELL           CN01360302K0005  14NV5        N/A            N/A
Ethernet208  QSFP28 100GBASE-BIDI                 3.5             DELL           CN07919299K01AR  0X9CT        N/A            N/A
Ethernet216  N/A                                  N/A             N/A            N/A              N/A          N/A            N/A
Ethernet224  QSFP28 100GBASE-LR4                  4.0             DELL           CN04829499P0050  D7P80        N/A            N/A
Ethernet232  QSFP28 100GBASE-LR4                  4.0             DELL           CN04829499P0088  D7P80        N/A            N/A
Ethernet240  QSFP28 100GBASE-FR                   4.0             DELL EMC       CN0482940790009  PJ62G        N/A            N/A
Ethernet248  QSFP28 100GBASE-FR                   4.0             DELL EMC       CN04829406B0009  PJ62G        N/A            N/A
Ethernet256  N/A                                  N/A             N/A            N/A              N/A          N/A            N/A
Ethernet257  N/A                                  N/A             N/A            N/A              N/A          N/A            N/A

@ghost
Copy link

ghost commented Oct 9, 2020

CLA assistant check
All CLA requirements met.

@lgtm-com
Copy link

lgtm-com bot commented Oct 9, 2020

This pull request introduces 1 alert when merging e7e6598 into 2e024de - view on LGTM.com

new alerts:

  • 1 for Unused local variable

@lguohan
Copy link
Contributor

lguohan commented Oct 11, 2020

please add unit tests and also fix lgtm alerts.

Copy link
Contributor

@lguohan lguohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add unit tests and also fix lgtm alerts.

geans-pin
geans-pin previously approved these changes Oct 12, 2020
Copy link

@geans-pin geans-pin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks ok, will approve once UT log is provided


def display_eeprom(self):
click.echo(self.output)
@multi_asic_util.run_on_multi_asic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add blank line above this

def cli():
"""sfpshow - Command line utility for display SFP transceivers information"""
pass
# 'summary' subcommand
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add blank line above this

@lgtm-com

This comment has been minimized.

@rck-innovium
Copy link
Contributor

Please update the command reference to include the new CLI.

show interfaces transceiver summary

sub = \
[interface, sfp_info_dict.get('display_name', 'N/A'), sfp_info_dict.get('power_rating_max', 'N/A'),
sfp_info_dict.get('vendor_name', 'N/A'), sfp_info_dict.get('vendor_serial_number', 'N/A'),
sfp_info_dict.get('vendor_part_number', 'N/A'), sfp_info_dict.get('qsa_adapter', 'N/A'), sfp_info_dict.get('qualified', 'N/A')]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to make the "Qualified" field in the show command optional, via a platform.json parameter? Concerned that it may cause confusion among users and vendors if vendors don’t implement it.

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.

6 participants