1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

finer grained failed/skipped on async for actions

fixes #23729
This commit is contained in:
Brian Coca 2017-04-19 11:35:25 -04:00 committed by Brian Coca
parent 5bbf0d9cb6
commit 3965689328
6 changed files with 9 additions and 9 deletions

View file

@ -90,17 +90,17 @@ class ActionBase(with_metaclass(ABCMeta, object)):
* Module parameters. These are stored in self._task.args
"""
result = {'skipped': True}
result = {}
if self._task.async and not self._supports_async:
result['msg'] = 'async is not supported for this task.'
result['failed'] = True
elif self._play_context.check_mode and not self._supports_check_mode:
result['msg'] = 'check mode is not supported for this task.'
result['skipped'] = True
elif self._task.async and self._play_context.check_mode:
result['msg'] = 'check mode and async cannot be used on same task.'
else:
# we run!
del result['skipped']
result['failed'] = True
return result

View file

@ -45,7 +45,7 @@ class ActionModule(ActionBase):
result = super(ActionModule, self).run(tmp, task_vars)
if result.get('skipped', False):
if result.get('skipped', False) or result.get('failed', False):
return result
# Parse out any hostname:port patterns

View file

@ -84,7 +84,7 @@ class ActionModule(ActionBase):
result = super(ActionModule, self).run(tmp, task_vars)
if result.get('skipped', False):
if result.get('skipped', False) or result.get('failed', False):
return result
if task_vars is None:

View file

@ -40,7 +40,7 @@ class ActionModule(ActionBase):
result = super(ActionModule, self).run(tmp, task_vars)
if result.get('skipped'):
if result.get('skipped', False) or result.get('failed', False):
return result
source = self._task.args.get('src', None)

View file

@ -38,7 +38,7 @@ class ActionModule(ActionBase):
result = super(ActionModule, self).run(tmp, task_vars)
if result.get('skipped', False):
if result.get('skipped', False) or result.get('failed', False):
return result
module = self._task.args.get('use', 'auto')

View file

@ -37,7 +37,7 @@ class ActionModule(ActionBase):
result = super(ActionModule, self).run(tmp, task_vars)
if result.get('skipped', False):
if result.get('skipped', False) or result.get('failed', False):
return result
module = self._task.args.get('use', 'auto').lower()