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
The error message about the failure to import a 'gpg' key by the 'ansible.builtin.apt_key' module was incorrect #74476
Conversation
2c9fcea
to
d7d7330
Compare
d7d7330
to
117d27d
Compare
ready_for_review |
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.
Please remove the binary file apt-key-corrupt-zeros-2k.gpg
.
ad807bb
to
9f9365c
Compare
…ible.builtin.apt_key' module was incorrect (ansible#74423) Co-authored-by: Sam Doran <sdoran@redhat.com>
c88fbad
to
e4d7fc9
Compare
@samdoran I have removed the binary file |
ready_for_review |
Please create a backport PR against |
Thank you for accepting the request! I will create a backport as @samdoran suggested. |
I have created a backport at #74521 |
SUMMARY
When importing a key by the
apt_key
module, in case of error, the error message was incorrect, because the logic to distinguish between the file name and the explicit data was inversed.The error message was:
Unable to extract key from '-'
While it should have been:
Unable to extract key from 'inline data'
The relevant code is in the following line from:
/lib/ansible/modules/apt_key.py
module.fail_json(msg="Unable to extract key from '%s'" % ('inline data' if data is None else filename), stdout=out, stderr=err)
(it should have been
if data is None
)ISSUE TYPE
COMPONENT NAME
lib/ansible/modules/apt_key
ADDITIONAL INFORMATION
Fixes: #74423
To reproduce this error, create the following files:
The
Vagrantfile
file:The
test.yaml
file:and run
vagrant up
Expected Results:
Unable to extract key from 'inline data'
Actual Results:
Unable to extract key from '-'
@Akasurde - please review