Skip to content

Commit

Permalink
Fix instantiation of action plugin in test fixture
Browse files Browse the repository at this point in the history
In Ansible 2.3+, the base action plugin class' run method depends
accessing attributes (check_mode) of its play_context.

In older versions play_context was not involved in run, and thus None
was passed in.
  • Loading branch information
rhcarvalho committed Apr 13, 2017
1 parent 8515131 commit 9e8ffde
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion roles/openshift_health_checker/test/action_plugin_test.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -34,7 +36,7 @@ def run(self, tmp, task_vars):
@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


Expand Down

0 comments on commit 9e8ffde

Please sign in to comment.