Skip to content

Commit

Permalink
fix: extraction of module UI
Browse files Browse the repository at this point in the history
The cluster leader keeps a copy of UI code. During the module update the
previous UI code is renamed before being deleted. If an error occurs it
is ignored in this case.
  • Loading branch information
DavidePrincipi committed Mar 5, 2025
1 parent d3e98a5 commit e542d14
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ for idx, retval in enumerate(update_retvals):
agent.run_helper('extract-ui', image_url).check_returncode()
# Replace the app UI directory. Cannot find a way to do this
# atomically and faster.
os.rename(appspath + mid, appspath + mid + dsfx + '~')
try:
os.rename(appspath + mid, appspath + mid + dsfx + '~')
except Exception as ex:
print(agent.SD_WARNING + f"Cannot rename the old {mid} UI directory:", ex, file=sys.stderr)
pass # ignore errors if the source dir is missing
os.rename(appspath + mid + dsfx, appspath + mid)
agent.run_helper('rm', '-rf', appspath + mid + dsfx + '~')
# Remove the previous image, we do not need anymore
Expand Down

0 comments on commit e542d14

Please sign in to comment.