Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chassis][psud] Move the PSU parent information generation to the loop run function from the initialization function #576

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions sonic-psud/scripts/psud
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,6 @@ 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 @@ -438,6 +435,13 @@ class DaemonPsud(daemon_base.DaemonBase):
# We received a fatal signal
return False

# Update predefined position_in_parent and parent_name for PSU
# it was in the __init__ function which means will be run only once
# But there's chance that the keys(PHYSICAL_ENTITY_INFO|*) got removed by other processes,
# like the exit function during the restart of thermalctld,
# hence move it to the iteration run, so the key will be filled again after removed.
self._update_psu_entity_info()

self.update_psu_data()
self._update_led_color()

Expand Down
Loading