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

systemd: fix global scope #57174

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open

Conversation

@tchernomax
Copy link
Contributor

@tchernomax tchernomax commented May 30, 2019

SUMMARY

major rewrite of systemd.py

I start with #55936 but discovered that:

  1. I was wrong
  2. other parts of the code was also wrong

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

systemd

@tchernomax
Copy link
Contributor Author

@tchernomax tchernomax commented May 30, 2019

ping @bcoca

@ansibot
Copy link
Contributor

@ansibot ansibot commented Jun 18, 2019

The test ansible-test sanity --test pylint [explain] failed with 2 errors:

lib/ansible/modules/system/systemd.py:428:73: undefined-variable Undefined variable 'systemctl_list_unit_files'
lib/ansible/modules/system/systemd.py:435:77: undefined-variable Undefined variable 'systemctl_list_unit_files'

The test ansible-test sanity --test import --python 3.8 [explain] failed with 1 error:

lib/ansible/modules/system/systemd.py:499:0: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?

click here for bot help

@ansibot
Copy link
Contributor

@ansibot ansibot commented Aug 24, 2019

The test ansible-test sanity --test compile --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/system/systemd.py:277:54: SyntaxError: return service_status['ActiveState'] in {'active', 'activating', 'deactivating'}

The test ansible-test sanity --test import --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/system/systemd.py:277:54: SyntaxError: invalid syntax

click here for bot help

Copy link
Contributor

@jamescassell jamescassell left a comment

shipit

Would be good to have a better explanation for each change.


is_found = result['status'].get('LoadState', 'not-found') != 'not-found'
is_masked = result['status'].get('LoadState', 'not-found') == 'masked'
# UnitFileState is not available on old systemd version (pre 230,
Copy link
Contributor

@jamescassell jamescassell Aug 24, 2019

Which version is in RHEL 7?

Copy link
Contributor Author

@tchernomax tchernomax Aug 24, 2019

@jamescassell It seam RHEL 7 use systemd 219.

(thanks for the review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants