Skip to content

Commit

Permalink
[xcvrd] Save the dom_capability of transceiver into db (sonic-net#72)
Browse files Browse the repository at this point in the history
Add a field-value pair when it try to set the table inside "post_port_sfp_info_to_db" function
  • Loading branch information
kuanyu99 authored Feb 24, 2021
1 parent b9381a5 commit 47bcf90
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sonic-xcvrd/tests/test_xcvrd.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ def test_post_port_dom_threshold_info_to_db(self):
'specification_compliance': '0.7',
'nominal_bit_rate': '0.7',
'application_advertisement': '0.7',
'is_replaceable': '0.7', }))
'is_replaceable': '0.7',
'dom_capability': '0.7', }))
def test_post_port_sfp_info_to_db(self):
logical_port_name = "Ethernet0"
stop_event = threading.Event()
Expand Down Expand Up @@ -156,7 +157,8 @@ def test_post_port_sfp_info_to_db(self):
'specification_compliance': '0.7',
'nominal_bit_rate': '0.7',
'application_advertisement': '0.7',
'is_replaceable': '0.7', }))
'is_replaceable': '0.7',
'dom_capability': '0.7', }))
@patch('xcvrd.xcvrd._wrapper_get_transceiver_dom_threshold_info', MagicMock(return_value={'temphighalarm': '22.75',
'temphighwarning': '0.5',
'templowalarm': '0.7',
Expand Down
1 change: 1 addition & 0 deletions sonic-xcvrd/xcvrd/xcvrd.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ def post_port_sfp_info_to_db(logical_port_name, table, transceiver_dict,
('application_advertisement', port_info_dict['application_advertisement']
if 'application_advertisement' in port_info_dict else 'N/A'),
('is_replaceable', str(is_replaceable)),
('dom_capability',port_info_dict['dom_capability']),
])
table.set(port_name, fvs)
else:
Expand Down

0 comments on commit 47bcf90

Please sign in to comment.