-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
service_facts: fix for systemd 245 #68211
Merged
Merged
Conversation
This file contains 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
I can verify that this pull request resolves this issue. See my output in #68536 Cheers |
Since systemd 245, `systemctl list-unit-files` comes with a new column "VENDOR PRESET" [1] and breaks the service_facts module: $ ansible localhost -m service_facts localhost | FAILED! => { "changed": false, "msg": "Malformed output discovered from systemd list-unit-files: auditd.service disabled disabled " } This patch drops the third column to make it work with old and new systemd. With the new slice operation, IndexError instead of ValueError is raised if the output contains less than 2 columns. Test plan: running `ansible-test integration -v service_facts` on up-to-date Arch Linux [1] systemd/systemd#14445
Signed-off-by: Rick Elrod <rick@elrod.me>
jrosser
pushed a commit
to jrosser/ansible
that referenced
this pull request
Apr 28, 2020
* service_facts: fix for systemd 245 Since systemd 245, `systemctl list-unit-files` comes with a new column "VENDOR PRESET" [1] and breaks the service_facts module: $ ansible localhost -m service_facts localhost | FAILED! => { "changed": false, "msg": "Malformed output discovered from systemd list-unit-files: auditd.service disabled disabled " } This patch drops the third column to make it work with old and new systemd. With the new slice operation, IndexError instead of ValueError is raised if the output contains less than 2 columns. Test plan: running `ansible-test integration -v service_facts` on up-to-date Arch Linux [1] systemd/systemd#14445 * add changelog Signed-off-by: Rick Elrod <rick@elrod.me> Co-authored-by: Rick Elrod <rick@elrod.me>
bcoca
pushed a commit
to bcoca/ansible
that referenced
this pull request
Apr 28, 2020
* service_facts: fix for systemd 245 Since systemd 245, `systemctl list-unit-files` comes with a new column "VENDOR PRESET" [1] and breaks the service_facts module: $ ansible localhost -m service_facts localhost | FAILED! => { "changed": false, "msg": "Malformed output discovered from systemd list-unit-files: auditd.service disabled disabled " } This patch drops the third column to make it work with old and new systemd. With the new slice operation, IndexError instead of ValueError is raised if the output contains less than 2 columns. Test plan: running `ansible-test integration -v service_facts` on up-to-date Arch Linux [1] systemd/systemd#14445 * add changelog Signed-off-by: Rick Elrod <rick@elrod.me> Co-authored-by: Rick Elrod <rick@elrod.me>
This was referenced May 4, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bug
This issue/PR relates to a bug.
core_review
In order to be merged, this PR must follow the core review workflow.
has_issue
module
This issue/PR relates to a module.
new_contributor
This PR is the first contribution by a new community member.
P3
Priority 3 - Approved, No Time Limitation
support:community
This issue/PR relates to code supported by the Ansible community.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
system
System category
verified
This issue has been verified/reproduced by maintainer
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.
SUMMARY
Since systemd 245,
systemctl list-unit-files
comes with a new column"VENDOR PRESET" [1] and breaks the service_facts module (see
additional information below).
This patch drops the third column to make it work with old and new
systemd. With the new slice operation, IndexError instead of ValueError
is raised if the output contains less than 2 columns.
Test plan: running
ansible-test integration -v service_facts
onup-to-date Arch Linux
[1] systemd/systemd#14445
ISSUE TYPE
COMPONENT NAME
service_facts module
ADDITIONAL INFORMATION