mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 14:20:22 -07:00
Use the the new features of fail_if_missing for checkmode (#5750)
This commit is contained in:
parent
d2fec9d259
commit
d41b4e3802
2 changed files with 5 additions and 5 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue