From ede90c05394ac6a7716407a8136ae4f5e26aa8fc Mon Sep 17 00:00:00 2001 From: Ramesh Raghupathy Date: Fri, 6 Dec 2024 12:03:36 -0800 Subject: [PATCH] Addressed review comments --- scripts/process-reboot-cause | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/process-reboot-cause b/scripts/process-reboot-cause index 1d17d292..7a5f75a5 100755 --- a/scripts/process-reboot-cause +++ b/scripts/process-reboot-cause @@ -19,6 +19,7 @@ except ImportError as err: raise ImportError("%s - required module not found" % str(err)) VERSION = "1.0" +CHASSIS_SERVER_PORT = 6380 SYSLOG_IDENTIFIER = "process-reboot-cause" @@ -88,9 +89,9 @@ def get_sorted_reboot_cause_files(dpu_history_path): return [] -def read_dpu_reboot_cause_files_and_save_chassis_state_db(): +def save_dpu_reboot_cause_files_to_chassis_state_db(): """Retrieve reboot cause from history files and save them to chassisStateDB.""" - chassis_state_db = swsscommon.SonicV2Connector(host="redis_chassis.server", port=6380) + chassis_state_db = swsscommon.SonicV2Connector(host="redis_chassis.server", port=CHASSIS_SERVER_PORT) chassis_state_db.connect(chassis_state_db.CHASSIS_STATE_DB) try: @@ -154,7 +155,7 @@ def main(): # For smartswitch platform store the DPU reboot-cause to CHASSIS_STATE_DB if device_info.is_smartswitch(): - read_dpu_reboot_cause_files_and_save_chassis_state_db() + save_dpu_reboot_cause_files_to_chassis_state_db() if __name__ == "__main__":