-
Notifications
You must be signed in to change notification settings - Fork 22
installFromYum: give more detailed error messages on gpg errors #71
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
Open
ydirson
wants to merge
1
commit into
xenserver:master
Choose a base branch
from
xcp-ng:gpg-diags
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -844,10 +844,38 @@ def updateInstallProgress(m): | |
| total = 0 | ||
| updateInstallProgress(m) | ||
| rv = p.wait() | ||
| gpg_error_message = None | ||
|
|
||
| if stderr.find(' in import_key_to_pubring') >= 0: | ||
| gpg_error_message = "Signature key import failed" | ||
| # add any other instance of uncaught GpgmeError before this like | ||
| elif stderr.find('gpgme.GpgmeError: ') >= 0: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor. I find elif 'gpgme.GpgmeError: ' in stderr:more readable. |
||
| gpg_error_message = "Cryptography-related yum crash" | ||
|
|
||
| elif re.search("Couldn't open file [^ ]*/repodata/repomd.xml.asc", stderr): | ||
| # would otherwise be mistaken for "pubring import" !? | ||
| gpg_error_message = "No signature on repository metadata" | ||
| elif stderr.find('repomd.xml signature could not be verified') >= 0: | ||
| gpg_error_message = "Repository signature verification failure" | ||
|
|
||
| else: | ||
| match = re.search("Public key for ([^ ]*.rpm) is not installed", stderr) | ||
| if match: | ||
| gpg_error_message = "Missing key for %s" % (match.group(1),) | ||
| match = re.search("Package ([^ ]*.rpm) is not signed", stderr) | ||
| if match: | ||
| gpg_error_message = "Package not signed: %s" % (match.group(1),) | ||
| match = re.search(r" ([^ ]*): \[Errno [0-9]*\] No more mirrors to try", stderr) | ||
| if match: | ||
| # rpm not found or corrupted/re-signed/etc | ||
| gpg_error_rpm_not_found = match.group(1) | ||
| gpg_error_message = "Cannot find valid rpm for %s" % (match.group(1),) | ||
|
|
||
| if rv: | ||
| logger.log("DNF exited with %d" % rv) | ||
| raise ErrorInstallingPackage("Error installing packages") | ||
| if gpg_error_message is None: | ||
| gpg_error_message = "Error installing packages" | ||
| raise ErrorInstallingPackage(gpg_error_message) | ||
|
|
||
| shutil.rmtree(os.path.join(mounts['root'], cachedir), ignore_errors=True) | ||
|
|
||
|
|
||
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.
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.
Why this extra indentation?
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.
Ah this is an badly solved merge conflict with 522558a, which will need to be reverted first. Any hint about what problems this was stderr capture was seen to cause?
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.
DNF5 output some information we need to stderr instead of stdout. So we don't separate stderr now. I suppose you would need to collect it somehow now.
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.
It's not really easy for me to do such forward-porting on
master(especially testing), since we've not started to use that branch. Would it be possible to target xs8 first, and then once that gets accepted start to work on amasterversion, to streamline the process a bit more?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.
Sure, fine with me
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.
It took some time to get back to it, but #334 is here at last.