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

Update transceiver info DB key names #146

Merged
merged 1 commit into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/sonic_ax_impl/mibs/ietf/rfc2737.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ class XcvrInfoDB(bytes, Enum):
"""

TYPE = b"type"
HARDWARE_REVISION = b"hardwarerev"
SERIAL_NUMBER = b"serialnum"
MANUFACTURE_NAME = b"manufacturename"
MODEL_NAME = b"modelname"
HARDWARE_REVISION = b"hardware_rev"
SERIAL_NUMBER = b"serial"
MANUFACTURE_NAME = b"manufacturer"
MODEL_NAME = b"model"
Copy link
Contributor

Choose a reason for hiding this comment

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

It is better to move into a common place and shared with the repo sonic-platform-common.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would prevent the need for dependent changes like this in the future. Please feel free to open an issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you clarify "prevent the need for dependent changes like this in the future"? I think it will make it easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This PR was necessary because the key names were updated in sonic-platform-common. If the two repos shared a common source for the data, this PR would not be necessary.



# Map used to generate sensor description
Expand Down
8 changes: 4 additions & 4 deletions tests/mock_tables/asic0/state_db.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"TRANSCEIVER_INFO|Ethernet0": {
"type": "QSFP+",
"hardwarerev" : "A1",
"serialnum": "SERIAL_NUM",
"manufacturename": "VENDOR_NAME",
"modelname": "MODEL_NAME"
"hardware_rev": "A1",
"serial": "SERIAL_NUM",
"manufacturer": "VENDOR_NAME",
"model": "MODEL_NAME"
},
"TRANSCEIVER_DOM_SENSOR|Ethernet0": {
"temperature": 25.39,
Expand Down
8 changes: 4 additions & 4 deletions tests/mock_tables/asic1/state_db.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"TRANSCEIVER_INFO|Ethernet8": {
"type": "QSFP+",
"hardwarerev" : "A1",
"serialnum": "SERIAL_NUM",
"manufacturename": "VENDOR_NAME",
"modelname": "MODEL_NAME"
"hardware_rev": "A1",
"serial": "SERIAL_NUM",
"manufacturer": "VENDOR_NAME",
"model": "MODEL_NAME"
},
"TRANSCEIVER_DOM_SENSOR|Ethernet8": {
"temperature": 30.39,
Expand Down
8 changes: 4 additions & 4 deletions tests/mock_tables/state_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
},
"TRANSCEIVER_INFO|Ethernet0": {
"type": "QSFP+",
"hardwarerev" : "A1",
"serialnum": "SERIAL_NUM",
"manufacturename": "VENDOR_NAME",
"modelname": "MODEL_NAME"
"hardware_rev": "A1",
"serial": "SERIAL_NUM",
"manufacturer": "VENDOR_NAME",
"model": "MODEL_NAME"
},
"TRANSCEIVER_DOM_SENSOR|Ethernet0": {
"temperature": 25.39,
Expand Down