From 515265a5e801cd8db242171a21f22fae4906b12b Mon Sep 17 00:00:00 2001 From: mihirpat1 <112018033+mihirpat1@users.noreply.github.com> Date: Tue, 18 Jun 2024 10:32:03 -0700 Subject: [PATCH] Update TRANSCEIVER_FIRMWARE_INFO table for all targets in sfputil (#3370) Signed-off-by: Mihir Patel --- sfputil/main.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sfputil/main.py b/sfputil/main.py index ad0b1b3775..4bb9058d79 100644 --- a/sfputil/main.py +++ b/sfputil/main.py @@ -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()