Skip to content

Commit

Permalink
Update TRANSCEIVER_FIRMWARE_INFO table for all targets in sfputil (#3370
Browse files Browse the repository at this point in the history
)

Signed-off-by: Mihir Patel <[email protected]>
  • Loading branch information
mihirpat1 authored Jun 18, 2024
1 parent 3df762f commit 515265a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sfputil/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1316,10 +1316,8 @@ def update_firmware_info_to_state_db(port_name):
state_db.connect(state_db.STATE_DB)
transceiver_firmware_info_dict = platform_chassis.get_sfp(physical_port).get_transceiver_info_firmware_versions()
if transceiver_firmware_info_dict is not None:
active_firmware = transceiver_firmware_info_dict.get('active_firmware', 'N/A')
inactive_firmware = transceiver_firmware_info_dict.get('inactive_firmware', 'N/A')
state_db.set(state_db.STATE_DB, 'TRANSCEIVER_FIRMWARE_INFO|{}'.format(port_name), "active_firmware", active_firmware)
state_db.set(state_db.STATE_DB, 'TRANSCEIVER_FIRMWARE_INFO|{}'.format(port_name), "inactive_firmware", inactive_firmware)
for key, value in transceiver_firmware_info_dict.items():
state_db.set(state_db.STATE_DB, 'TRANSCEIVER_FIRMWARE_INFO|{}'.format(port_name), key, value)

# 'firmware' subgroup
@cli.group()
Expand Down

0 comments on commit 515265a

Please sign in to comment.