Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround for no Exception issue for some failed ansible modules (#1786
) Currently pytest-ansible depends on the 'failed' or 'rc' field in the module result to determine whether the result is failed. Some ansible modules only have 'failed' field in their results. Due to an issue of pytest-ansible: ansible/pytest-ansible#47 The module results returned by pytest-ansible do not have such 'failed' field even when the ansible module failed. In this case, the `is_failed` property will always be `False`. Consequent, no exception will be raised when running some ansible module failed. This commit is a workaround for this issue. According to current ansible behavior, the 'exception' field will be available in failed ansible module result most of the time. When such field is observed in the result, we raise `RunAnsibleModuleFail` exception too. Signed-off-by: Xin Wang <xiwang5@microsoft.com>
- Loading branch information