-
Notifications
You must be signed in to change notification settings - Fork 261
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
setup: Don’t fail cleanup on empty remote engine environment #492
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Not sure I fully understand the flow:
Are you sure it's related to engine-setup failing or not? IIUC, the failure is simply that _setup (of this module) didn't yet run when the tool you run (can be setup, cleanup, whatever) already failed, for whatever reason - dnf repos, or just pressing Ctrl-C at the right moment.
Code looks ok, but might have been cleaner (pun not intended) to move this function instead to STAGE_CLOSEUP. The difference between them is that STAGE_CLEANUP always runs (e.g. to tell the user where the log file is, etc.) and STAGE_CLOSEUP only runs if we didn't fail (and runs non-critical stuff that we can't, or don't want to, rollback - e.g. if a service fails to start, user can just start it manually or reboot the machine). Not sure why I put it in STAGE_CLEANUP originally. I don't believe there was a specific need. |
084d0ef
to
1b94f27
Compare
Yes, this is the probable cause.
OK, let's do it this way. |
When engine-setup fails on dnf repositories download, the followup cleanup fails with [ ERROR ] Failed to execute stage 'Clean up': 'NoneType' object has no attribute 'cleanup' This patch moves the corresponding cleanup call from STAGE_CLEANUP to STAGE_CLOSEUP. STAGE_CLOSEUP only runs if we didn't fail and runs non-critical stuff that we can't, or don't want to, rollback. This way, we can be sure that the cleanup is not run before the given environment item is assigned.
/ost |
Seems to be working. @didib WDYT, can we take it? |
When engine-setup fails on dnf repositories download, the followup
cleanup fails with
[ ERROR ] Failed to execute stage 'Clean up': 'NoneType' object has no attribute 'cleanup'
This patch fixes it and allows the cleanup finish normally.