From 6338780e779d303fdb2c3489bc2318365e038fa3 Mon Sep 17 00:00:00 2001 From: "Jose M. Prieto" Date: Thu, 6 Aug 2020 23:15:23 +0200 Subject: [PATCH 1/3] Add pycharm config directory to .gitignore Signed-off-by: Jose M. Prieto --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 8498390c..99b747d0 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,5 @@ docs/_build/ # PyBuilder target/ +# pycharm +.idea/ From bb7f9e68d5459f3a990a7122d24802990a746e0c Mon Sep 17 00:00:00 2001 From: "Jose M. Prieto" Date: Thu, 6 Aug 2020 23:54:01 +0200 Subject: [PATCH 2/3] Capture module failure in returned dictionary If module fails the callback plugin captures the event by adding fields "rc" and "failed" to the return dict so that properties like "is_failed" later on returns True Signed-off-by: Jose M. Prieto --- pytest_ansible/module_dispatcher/v28.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pytest_ansible/module_dispatcher/v28.py b/pytest_ansible/module_dispatcher/v28.py index 6b7b1067..098a0d05 100644 --- a/pytest_ansible/module_dispatcher/v28.py +++ b/pytest_ansible/module_dispatcher/v28.py @@ -34,9 +34,12 @@ def __init__(self, *args, **kwargs): self.unreachable = {} def v2_runner_on_failed(self, result, *args, **kwargs): - self.contacted[result._host.get_name()] = result._result + result2 = dict(failed=True) + result2.update(result._result) + self.contacted[result._host.get_name()] = result2 - v2_runner_on_ok = v2_runner_on_failed + def v2_runner_on_ok(self, result): + self.contacted[result._host.get_name()] = result._result def v2_runner_on_unreachable(self, result): self.unreachable[result._host.get_name()] = result._result From 3d63bd45c4b25b437aa3e21c06b7ccf93cdecd33 Mon Sep 17 00:00:00 2001 From: "Jose M. Prieto" Date: Thu, 6 Aug 2020 23:17:54 +0200 Subject: [PATCH 3/3] Version 2.2.3rc0 Signed-off-by: Jose M. Prieto --- pytest_ansible/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest_ansible/__init__.py b/pytest_ansible/__init__.py index b198decf..564e601f 100644 --- a/pytest_ansible/__init__.py +++ b/pytest_ansible/__init__.py @@ -1,5 +1,5 @@ """The pytest-ansible initialization.""" -__version__ = "2.2.2" +__version__ = "2.2.3rc0" __author__ = "James Laska" __author_email__ = ""