docker_*: always use client.fail() over module.fail_json(), allow to always return data on failure (#51999)

* Always use client.fail() instead of module.fail_json().

* Allow to pass on results on module failure.

* Linting.
This commit is contained in:
Felix Fontein 2019-02-13 20:10:23 +01:00 committed by ansibot
parent ad386290b4
commit d7fd4d0550
12 changed files with 64 additions and 60 deletions

View file

@ -202,7 +202,7 @@ def main():
cache_min_version = '3.3.0'
if client.module.params['builder_cache'] and client.docker_py_version < LooseVersion(cache_min_version):
msg = "Error: docker version is %s. Minimum version required for builds option is %s. Use `pip install --upgrade docker` to upgrade."
client.module.fail(msg=(msg % (docker_version, cache_min_version)))
client.fail(msg % (docker_version, cache_min_version))
result = dict()