Skip to content
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 2 commits into from
Apr 24, 2020
Merged

service_facts: fix for systemd 245 #68211

merged 2 commits into from
Apr 24, 2020

Conversation

yan12125
Copy link
Contributor

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 on
up-to-date Arch Linux

[1] systemd/systemd#14445

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

service_facts module

ADDITIONAL INFORMATION
$ ansible localhost -m service_facts
localhost | FAILED! => {
    "changed": false,
    "msg": "Malformed output discovered from systemd list-unit-files: auditd.service                             disabled        disabled     "
}

@ansibot
Copy link
Contributor

ansibot commented Mar 13, 2020

@ansibot ansibot added affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. small_patch support:community This issue/PR relates to code supported by the Ansible community. system System category labels Mar 13, 2020
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Mar 22, 2020
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed community_review In order to be merged, this PR must follow the community review workflow. support:community This issue/PR relates to code supported by the Ansible community. labels Mar 30, 2020
@fgimian
Copy link

fgimian commented Apr 3, 2020

I can verify that this pull request resolves this issue. See my output in #68536

Cheers
Fotis

@bcoca bcoca self-assigned this Apr 14, 2020
@bcoca bcoca added needs_verified This issue needs to be verified/reproduced by maintainer P3 Priority 3 - Approved, No Time Limitation and removed affects_2.10 This issue/PR affects Ansible v2.10 needs_triage Needs a first human triage before being processed. labels Apr 14, 2020
@Akasurde Akasurde added verified This issue has been verified/reproduced by maintainer and removed needs_verified This issue needs to be verified/reproduced by maintainer labels Apr 24, 2020
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Apr 24, 2020
Chih-Hsuan Yen and others added 2 commits April 24, 2020 18:13
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>
@ansibot ansibot added the support:community This issue/PR relates to code supported by the Ansible community. label Apr 24, 2020
@relrod relrod merged commit bd4fdb1 into ansible:devel Apr 24, 2020
@yan12125 yan12125 deleted the service_facts-systmd-245 branch April 25, 2020 15:29
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>
@ansible ansible locked and limited conversation to collaborators May 22, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants