mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 15:11:23 -07:00
use new 'warn' method
this also prevents warnings from being lost
This commit is contained in:
parent
46f9648aa1
commit
300718e811
1 changed files with 1 additions and 2 deletions
|
@ -283,7 +283,6 @@ def main():
|
||||||
'name': unit,
|
'name': unit,
|
||||||
'changed': False,
|
'changed': False,
|
||||||
'status': {},
|
'status': {},
|
||||||
'warnings': [],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Run daemon-reload first, if requested
|
# Run daemon-reload first, if requested
|
||||||
|
@ -331,7 +330,7 @@ def main():
|
||||||
# Does service exist?
|
# Does service exist?
|
||||||
found = is_systemd or is_initd
|
found = is_systemd or is_initd
|
||||||
if is_initd and not is_systemd:
|
if is_initd and not is_systemd:
|
||||||
result['warnings'].append('The service (%s) is actually an init script but the system is managed by systemd' % unit)
|
module.warn('The service (%s) is actually an init script but the system is managed by systemd' % unit)
|
||||||
|
|
||||||
# mask/unmask the service, if requested, can operate on services before they are installed
|
# mask/unmask the service, if requested, can operate on services before they are installed
|
||||||
if module.params['masked'] is not None:
|
if module.params['masked'] is not None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue