From 590d6c12528654bf4e391a7f47662b038b5601a8 Mon Sep 17 00:00:00 2001 From: Rodolfo Carvalho Date: Thu, 13 Apr 2017 12:16:48 +0200 Subject: Fix instantiation of action plugin in test fixture In Ansible 2.3+, the base action plugin class' run method depends on accessing attributes (check_mode) of its play_context. In older versions play_context was not involved in run, and thus None was passed in. --- roles/openshift_health_checker/test/action_plugin_test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'roles') diff --git a/roles/openshift_health_checker/test/action_plugin_test.py b/roles/openshift_health_checker/test/action_plugin_test.py index a877246f4..2693ae37b 100644 --- a/roles/openshift_health_checker/test/action_plugin_test.py +++ b/roles/openshift_health_checker/test/action_plugin_test.py @@ -1,5 +1,7 @@ import pytest +from ansible.playbook.play_context import PlayContext + from openshift_health_check import ActionModule, resolve_checks from openshift_checks import OpenShiftCheckException @@ -34,7 +36,7 @@ def fake_check(name='fake_check', tags=None, is_active=True, run_return=None, ru @pytest.fixture def plugin(): task = FakeTask('openshift_health_check', {'checks': ['fake_check']}) - plugin = ActionModule(task, None, None, None, None, None) + plugin = ActionModule(task, None, PlayContext(), None, None, None) return plugin -- cgit v1.2.3