Check for correct version of systemd Python library (#60692)

Fix issue where some versions of systemd don't have journal.sendv
This commit is contained in:
Rylan Polster 2020-05-12 01:31:08 -04:00 committed by GitHub
parent b309c14265
commit eb40ecc843
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- Add an additional check for importing journal from systemd-python module (https://github.com/ansible/ansible/issues/60595).

View file

@ -65,7 +65,9 @@ except ImportError:
try:
from systemd import journal
has_journal = True
# Makes sure that systemd.journal has method sendv()
# Double check that journal has method sendv (some packages don't)
has_journal = hasattr(journal, 'sendv')
except ImportError:
has_journal = False