summaryrefslogtreecommitdiffstats
path: root/roles/openshift_health_checker
diff options
context:
space:
mode:
authorRodolfo Carvalho <rhcarvalho@gmail.com>2017-04-13 12:16:48 +0200
committerRodolfo Carvalho <rhcarvalho@gmail.com>2017-04-13 15:12:32 +0200
commit590d6c12528654bf4e391a7f47662b038b5601a8 (patch)
tree8c359fb4d1848276e9bfd6978605be5124b0967d /roles/openshift_health_checker
parent8515131a88fa3105ade6d209a84b5d6e9ef84e6d (diff)
downloadopenshift-590d6c12528654bf4e391a7f47662b038b5601a8.tar.gz
openshift-590d6c12528654bf4e391a7f47662b038b5601a8.tar.bz2
openshift-590d6c12528654bf4e391a7f47662b038b5601a8.tar.xz
openshift-590d6c12528654bf4e391a7f47662b038b5601a8.zip
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.
Diffstat (limited to 'roles/openshift_health_checker')
-rw-r--r--roles/openshift_health_checker/test/action_plugin_test.py4
1 files changed, 3 insertions, 1 deletions
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