From 4533780f0104af851ce8cff7d2b2dfc9697ce379 Mon Sep 17 00:00:00 2001 From: PJHsieh <49477291+PJHsieh@users.noreply.github.com> Date: Mon, 22 Apr 2024 06:13:04 +0800 Subject: [PATCH] [PSUd]Update predefined position_in_parent and parent_name of PSU only once (#452) The values of position_in_parent and parent_name for PSU will remain unchanged. Consequently, update the predefined position_in_parent and parent_name of the PSU only once. --- sonic-psud/scripts/psud | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sonic-psud/scripts/psud b/sonic-psud/scripts/psud index 3bcae4c76..013f8a082 100644 --- a/sonic-psud/scripts/psud +++ b/sonic-psud/scripts/psud @@ -403,6 +403,9 @@ class DaemonPsud(daemon_base.DaemonBase): fvs = swsscommon.FieldValuePairs([(CHASSIS_INFO_PSU_NUM_FIELD, str(self.num_psus))]) self.chassis_tbl.set(CHASSIS_INFO_KEY, fvs) + # Update predefined position_in_parent and parent_name for PSU + self._update_psu_entity_info() + def __del__(self): # Delete all the information from DB and then exit for psu_index in range(1, self.num_psus + 1): @@ -433,7 +436,6 @@ class DaemonPsud(daemon_base.DaemonBase): # We received a fatal signal return False - self._update_psu_entity_info() self.update_psu_data() self._update_led_color()