CA-406020: parse dnf5 output in pool_update plugins#7078
Merged
stephenchengCloud merged 2 commits intoMay 21, 2026
Merged
Conversation
dnf was upgraded to dnf5, which prints transaction errors in a new format. The existing parsers in pool_update.precheck and pool_update.apply were written against dnf4 and silently fell through to a generic "unknown error" for every failure mode, hiding the real reason from XAPI. Signed-off-by: Stephen Cheng <stephen.cheng@citrix.com>
| INVALID_UPDATE = "INVALID_UPDATE" | ||
| ERROR_MESSAGE_DOWNLOAD_PACKAGE = "Error downloading packages:\n" | ||
| ERROR_MESSAGE_START = "Error: " | ||
| ERROR_MESSAGE_END = "You could try " |
Collaborator
Author
There was a problem hiding this comment.
Removed this block as it's duplicate with line 28-37.
| YUM_CMD = '/usr/bin/yum' | ||
| ERROR_MESSAGE_DOWNLOAD_PACKAGE = 'Failed to download packages' | ||
| DNF_CMD = '/usr/bin/dnf' | ||
| PKG_MGR = DNF_CMD if os.path.exists(DNF_CMD) else YUM_CMD |
Collaborator
Author
There was a problem hiding this comment.
Also removed yum related code.
chunjiez
reviewed
May 20, 2026
| 'The package is not signed.', | ||
| 'GPG signature verification error', | ||
| ) | ||
| ERROR_XML_START = '<error errorcode=' |
Collaborator
There was a problem hiding this comment.
Is the output of dnf program totally different?
Collaborator
Author
There was a problem hiding this comment.
Yes, by checking the dnf5 source code, the error messages are totally different.
minglumlu
approved these changes
May 20, 2026
Collaborator
|
Is it possible to unittest the code with example dnf output? |
Collaborator
Author
Yes, it is. In fact, i did the test locally. I can include the test in this PR. |
Signed-off-by: Stephen Cheng <stephen.cheng@citrix.com>
162e5d2 to
b2ca8b7
Compare
chunjiez
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dnf was upgraded to dnf5, which prints transaction errors in a new format. The existing parsers in pool_update.precheck and pool_update.apply were written against dnf4 and silently fell through to a generic "unknown error" for every failure mode, hiding the real reason from XAPI.
Tested and passed:
4648126 updatenegative.seq
4648212 supppackduringhostinstall.seq
4648128 supppackduringhostupgrade.seq
Also did manual tests for typical dnf5 transaction errors (conflict, non-existent pacakge, missing provides)