From 300718e8116bc586c51059928fd4d3c4c83e4a93 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 8 Feb 2017 15:46:14 -0500 Subject: [PATCH] use new 'warn' method this also prevents warnings from being lost --- lib/ansible/modules/system/systemd.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/ansible/modules/system/systemd.py b/lib/ansible/modules/system/systemd.py index 6372c184c6..c82bed60d1 100644 --- a/lib/ansible/modules/system/systemd.py +++ b/lib/ansible/modules/system/systemd.py @@ -283,7 +283,6 @@ def main(): 'name': unit, 'changed': False, 'status': {}, - 'warnings': [], } # Run daemon-reload first, if requested @@ -331,7 +330,7 @@ def main(): # Does service exist? found = is_systemd or is_initd 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 if module.params['masked'] is not None: