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
Invalid error message on GnuPG key import error in the apt_key module #74423
Labels
affects_2.12
bug
This issue/PR relates to a bug.
has_pr
This issue has an associated PR.
module
This issue/PR relates to a module.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
Comments
Files identified in the description: If these files are incorrect, please update the |
ansibot
added
affects_2.12
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
needs_triage
Needs a first human triage before being processed.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
labels
Apr 26, 2021
maximmasiutin
added a commit
to maximmasiutin/ansible
that referenced
this issue
Apr 26, 2021
…e error message was incorrect because of a mixed logic bug - see ansible#74423 ; The command line of GnuPG was logged in some cases but not logged in the other -- now it is logged in all cases; Some exceptions were not logged; Long strings made shorter to avoid pylint warnings; Fixed a pyling warning that the function did not always return a value
maximmasiutin
added a commit
to maximmasiutin/ansible
that referenced
this issue
Apr 26, 2021
…e error message was incorrect because of a mixed logic bug - see ansible#74423 ; The command line of GnuPG was logged in some cases but not logged in the other -- now it is logged in all cases; Some exceptions were not logged; Long strings made shorter to avoid pylint warnings; Fixed a pylint warning that the function did not always return a value; Not all GnuPG return codes were analyzed (rc != 0) and logged; Minor pylint issues resolved like (key_id_len != 8 and key_id_len != 16) replaced to (key_id_len not in (8, 16))
maximmasiutin
added a commit
to maximmasiutin/ansible
that referenced
this issue
Apr 27, 2021
…e error message was incorrect because of a mixed logic bug - see ansible#74423 ; The command line of GnuPG was logged in some cases but not logged in the other -- now it is logged in all cases; Some exceptions were not logged; Long strings made shorter to avoid pylint warnings; Fixed a pylint warning that the function did not always return a value; Not all GnuPG return codes were analyzed (rc != 0) and logged; Minor pylint issues resolved like (key_id_len != 8 and key_id_len != 16) replaced to (key_id_len not in (8, 16)); Added a test case and a changelog fragment
maximmasiutin
added a commit
to maximmasiutin/ansible
that referenced
this issue
Apr 27, 2021
…e error message was incorrect because of a mixed logic bug - see ansible#74423 ; The command line of GnuPG was logged in some cases but not logged in the other -- now it is logged in all cases; Some exceptions were not logged; Long strings made shorter to avoid pylint warnings; Fixed a pylint warning that the function did not always return a value; Not all GnuPG return codes were analyzed (rc != 0) and logged; Minor pylint issues resolved like (key_id_len != 8 and key_id_len != 16) replaced to (key_id_len not in (8, 16)); Added a test case and a changelog fragment
mkrizek
removed
the
needs_triage
Needs a first human triage before being processed.
label
Apr 27, 2021
maximmasiutin
added a commit
to maximmasiutin/ansible
that referenced
this issue
Apr 28, 2021
…ible.builtin.apt_key' module was incorrect (ansible#74423)
maximmasiutin
added a commit
to maximmasiutin/ansible
that referenced
this issue
Apr 28, 2021
…ible.builtin.apt_key' module was incorrect (ansible#74423)
maximmasiutin
added a commit
to maximmasiutin/ansible
that referenced
this issue
Apr 30, 2021
…ible.builtin.apt_key' module was incorrect (ansible#74423) Co-authored-by: Sam Doran <sdoran@redhat.com>
maximmasiutin
added a commit
to maximmasiutin/ansible
that referenced
this issue
Apr 30, 2021
…ible.builtin.apt_key' module was incorrect (ansible#74423) Co-authored-by: Sam Doran <sdoran@redhat.com>
Closed
maximmasiutin
added a commit
to maximmasiutin/ansible
that referenced
this issue
Apr 30, 2021
…ible.builtin.apt_key' module was incorrect (ansible#74423) Co-authored-by: Sam Doran <sdoran@redhat.com> (cherry picked from commit e4d7fc9)
Closed
maximmasiutin
added a commit
to maximmasiutin/ansible
that referenced
this issue
Apr 30, 2021
…ible.builtin.apt_key' module was incorrect (ansible#74423) Co-authored-by: Sam Doran <sdoran@redhat.com> (cherry picked from commit e4d7fc9)
maximmasiutin
added a commit
to maximmasiutin/ansible
that referenced
this issue
May 1, 2021
…ible.builtin.apt_key' module was incorrect (ansible#74423) Co-authored-by: Sam Doran <sdoran@redhat.com> (cherry picked from commit e4d7fc9)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
affects_2.12
bug
This issue/PR relates to a bug.
has_pr
This issue has an associated PR.
module
This issue/PR relates to a module.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
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
Bug Report
Component Name
ansible.builtin.apt_key module
Ansible Version
Configuration
config not changed
OS / Environment
Ubuntu 18
Steps to Reproduce
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 '-'
Relevant file:
lib/ansible/modules/apt_key.py
@jvantuyl - please review
@Akasurde - please review
Fixed by #74476
Code of Conduct
The text was updated successfully, but these errors were encountered: