Use the the new features of fail_if_missing for checkmode (#5750)

This commit is contained in:
jctanner 2016-11-28 14:15:12 -05:00 committed by Matt Clay
commit d41b4e3802
2 changed files with 5 additions and 5 deletions

View file

@ -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):