mirror of
https://github.com/ansible/awx.git
synced 2026-05-23 08:37:48 -02:30
Fix fail/skip scenario for scan service jobs
In the case where no services could be found we'll set the status as skipped instead of failed
This commit is contained in:
@@ -183,7 +183,8 @@ def main():
|
|||||||
if svcmod.incomplete_warning:
|
if svcmod.incomplete_warning:
|
||||||
incomplete_warning = True
|
incomplete_warning = True
|
||||||
if len(all_services) == 0:
|
if len(all_services) == 0:
|
||||||
module.fail_json(msg="Failed to find any services. Sometimes this is due to insufficient privileges.")
|
results = dict(skipped=True, msg="Failed to find any services. Sometimes this is due to insufficient privileges.")
|
||||||
|
else:
|
||||||
results = dict(ansible_facts=dict(services=all_services))
|
results = dict(ansible_facts=dict(services=all_services))
|
||||||
if incomplete_warning:
|
if incomplete_warning:
|
||||||
results['msg'] = "WARNING: Could not find status for all services. Sometimes this is due to insufficient privileges."
|
results['msg'] = "WARNING: Could not find status for all services. Sometimes this is due to insufficient privileges."
|
||||||
|
|||||||
Reference in New Issue
Block a user