-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
added handling of zypper exitcode 102: ZYPPER_EXIT_INF_REBOOT_NEEDED #6534
Conversation
…- Returned after a successful installation of a patch which requires reboot of computer. The exitcode 102 will be treated exactly like 0 by the module internally now, and the changed status will be reported correctly. However, since I preserve the rc 102 in the retvals to allow the playbook to react to the requested reboot, the task must still include a "failed_when: zypper_cmd.rc not in [0, 102]" to not fail in this case.
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.
Thanks for your contribution! Could you please add a changelog fragment? Thanks.
Looks great to me! Thank you for your contribution. Could you please add some static variable names for the return value codes? At this stage it still seems manageable. |
Co-authored-by: Alex <[email protected]>
I'll merge this by tomorrow morning if nobody objects (so it can make it into tomorrow's releases). Moving the literals to constants can be done in a follow-up PR. |
I'm good with that! |
Backport to stable-6: 💚 backport PR created✅ Backport PR branch: Backported as #6559 🤖 @patchback |
…6534) * added handling of zypper exitcode 102: ZYPPER_EXIT_INF_REBOOT_NEEDED - Returned after a successful installation of a patch which requires reboot of computer. The exitcode 102 will be treated exactly like 0 by the module internally now, and the changed status will be reported correctly. However, since I preserve the rc 102 in the retvals to allow the playbook to react to the requested reboot, the task must still include a "failed_when: zypper_cmd.rc not in [0, 102]" to not fail in this case. * removed trailing whitespaces * added changelogs fragment * Fix typo. Co-authored-by: Alex <[email protected]> * Add URL. --------- Co-authored-by: Felix Fontein <[email protected]> Co-authored-by: Alex <[email protected]> (cherry picked from commit a9fd9f8)
Backport to stable-7: 💚 backport PR created✅ Backport PR branch: Backported as #6560 🤖 @patchback |
…6534) * added handling of zypper exitcode 102: ZYPPER_EXIT_INF_REBOOT_NEEDED - Returned after a successful installation of a patch which requires reboot of computer. The exitcode 102 will be treated exactly like 0 by the module internally now, and the changed status will be reported correctly. However, since I preserve the rc 102 in the retvals to allow the playbook to react to the requested reboot, the task must still include a "failed_when: zypper_cmd.rc not in [0, 102]" to not fail in this case. * removed trailing whitespaces * added changelogs fragment * Fix typo. Co-authored-by: Alex <[email protected]> * Add URL. --------- Co-authored-by: Felix Fontein <[email protected]> Co-authored-by: Alex <[email protected]> (cherry picked from commit a9fd9f8)
…ode 102: ZYPPER_EXIT_INF_REBOOT_NEEDED (#6559) added handling of zypper exitcode 102: ZYPPER_EXIT_INF_REBOOT_NEEDED (#6534) * added handling of zypper exitcode 102: ZYPPER_EXIT_INF_REBOOT_NEEDED - Returned after a successful installation of a patch which requires reboot of computer. The exitcode 102 will be treated exactly like 0 by the module internally now, and the changed status will be reported correctly. However, since I preserve the rc 102 in the retvals to allow the playbook to react to the requested reboot, the task must still include a "failed_when: zypper_cmd.rc not in [0, 102]" to not fail in this case. * removed trailing whitespaces * added changelogs fragment * Fix typo. Co-authored-by: Alex <[email protected]> * Add URL. --------- Co-authored-by: Felix Fontein <[email protected]> Co-authored-by: Alex <[email protected]> (cherry picked from commit a9fd9f8) Co-authored-by: tover99 <[email protected]>
…ode 102: ZYPPER_EXIT_INF_REBOOT_NEEDED (#6560) added handling of zypper exitcode 102: ZYPPER_EXIT_INF_REBOOT_NEEDED (#6534) * added handling of zypper exitcode 102: ZYPPER_EXIT_INF_REBOOT_NEEDED - Returned after a successful installation of a patch which requires reboot of computer. The exitcode 102 will be treated exactly like 0 by the module internally now, and the changed status will be reported correctly. However, since I preserve the rc 102 in the retvals to allow the playbook to react to the requested reboot, the task must still include a "failed_when: zypper_cmd.rc not in [0, 102]" to not fail in this case. * removed trailing whitespaces * added changelogs fragment * Fix typo. Co-authored-by: Alex <[email protected]> * Add URL. --------- Co-authored-by: Felix Fontein <[email protected]> Co-authored-by: Alex <[email protected]> (cherry picked from commit a9fd9f8) Co-authored-by: tover99 <[email protected]>
added handling of zypper exitcode 102: ZYPPER_EXIT_INF_REBOOT_NEEDED - Returned after a successful installation of a patch which requires reboot of computer.
SUMMARY
This code was not treated at all by the module and therefore considered a faillure and the changed status was never set.
After my fix the exitcode 102 will be treated exactly like 0 by the module internally, and the changed status will be reported correctly.
However, since I preserve the rc 102 in the retvals to allow the playbook to react to the requested reboot, the task must still include a "register" and a "failed_when" property to pass as OK in this event.
Example:
ISSUE TYPE
COMPONENT NAME
zypper
ADDITIONAL INFORMATION
When used to do updates of the type "patch" the zypper module failed in case the updates were successfull, but resulted in the system needing a reboot. In that case the changed status was not correctly set. After my fix the task will still be treated a faillure by ansible unless you treat the rc 102 in a failed_when statement as shown above, but the changed state will be correctly set.