diff options
author | jctanner <tanner.jc@gmail.com> | 2016-11-28 14:15:12 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-28 14:15:12 -0500 |
commit | 84926c1c9d7a9cdb5b4a7d84b36b4d96470d6867 (patch) | |
tree | bafb17a2344ccb7f10930d26be4d517b1945015e /system/service.py | |
parent | e1e64c5aef636aaa4e5e697d02cfcbefef4365b8 (diff) | |
download | ansible-modules-core-84926c1c9d7a9cdb5b4a7d84b36b4d96470d6867.tar.gz |
Use the the new features of fail_if_missing for checkmode (#5750)
Diffstat (limited to 'system/service.py')
-rw-r--r-- | system/service.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/system/service.py b/system/service.py index a71e6382..af97e7df 100644 --- a/system/service.py +++ b/system/service.py @@ -131,6 +131,7 @@ import select import time import string import glob +from ansible.module_utils.service import fail_if_missing # The distutils module is not shipped with SUNWPython on Solaris. # It's in the SUNWPython-devel package which also contains development files @@ -493,7 +494,7 @@ class LinuxService(Service): self.enable_cmd = location['chkconfig'] if self.enable_cmd is None: - self.module.fail_json(msg="no service or tool found for: %s" % self.name) + fail_if_missing(self.module, False, self.name, msg='host') # If no service control tool selected yet, try to see if 'service' is available if self.svc_cmd is None and location.get('service', False): |