Skip to content

Commit 47bcf90

Browse files
authored
[xcvrd] Save the dom_capability of transceiver into db (zhenggen-xu#72)
Add a field-value pair when it try to set the table inside "post_port_sfp_info_to_db" function
1 parent b9381a5 commit 47bcf90

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

sonic-xcvrd/tests/test_xcvrd.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ def test_post_port_dom_threshold_info_to_db(self):
128128
'specification_compliance': '0.7',
129129
'nominal_bit_rate': '0.7',
130130
'application_advertisement': '0.7',
131-
'is_replaceable': '0.7', }))
131+
'is_replaceable': '0.7',
132+
'dom_capability': '0.7', }))
132133
def test_post_port_sfp_info_to_db(self):
133134
logical_port_name = "Ethernet0"
134135
stop_event = threading.Event()
@@ -156,7 +157,8 @@ def test_post_port_sfp_info_to_db(self):
156157
'specification_compliance': '0.7',
157158
'nominal_bit_rate': '0.7',
158159
'application_advertisement': '0.7',
159-
'is_replaceable': '0.7', }))
160+
'is_replaceable': '0.7',
161+
'dom_capability': '0.7', }))
160162
@patch('xcvrd.xcvrd._wrapper_get_transceiver_dom_threshold_info', MagicMock(return_value={'temphighalarm': '22.75',
161163
'temphighwarning': '0.5',
162164
'templowalarm': '0.7',

sonic-xcvrd/xcvrd/xcvrd.py

+1
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ def post_port_sfp_info_to_db(logical_port_name, table, transceiver_dict,
299299
('application_advertisement', port_info_dict['application_advertisement']
300300
if 'application_advertisement' in port_info_dict else 'N/A'),
301301
('is_replaceable', str(is_replaceable)),
302+
('dom_capability',port_info_dict['dom_capability']),
302303
])
303304
table.set(port_name, fvs)
304305
else:

0 commit comments

Comments
 (0)