mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 22:51:23 -07:00
added fail_if_missing shared service function
This commit is contained in:
parent
2d2bb626d4
commit
5129e2fe16
1 changed files with 3 additions and 0 deletions
|
@ -45,3 +45,6 @@ def get_sysv_script(name):
|
||||||
def sysv_exists(name):
|
def sysv_exists(name):
|
||||||
return os.path.exists(get_sysv_script(name))
|
return os.path.exists(get_sysv_script(name))
|
||||||
|
|
||||||
|
def fail_if_missing(module, found, service):
|
||||||
|
if not found:
|
||||||
|
module.fail_json(msg='Could not find the requested service %s' % (service))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue