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:
parent
b309c14265
commit
eb40ecc843
2 changed files with 5 additions and 1 deletions
2
changelogs/fragments/60595-systemd_import.yml
Normal file
2
changelogs/fragments/60595-systemd_import.yml
Normal 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).
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue