Skip to content

Commit

Permalink
[PSUd]Update predefined position_in_parent and parent_name of PSU onl…
Browse files Browse the repository at this point in the history
…y 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.
  • Loading branch information
PJHsieh authored Apr 21, 2024
1 parent 0f61e15 commit 4533780
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sonic-psud/scripts/psud
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 4533780

Please sign in to comment.