From a98a51a32885ffe6496c13099d132845514d2f00 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 1 Apr 2018 21:20:58 +0100 Subject: [PATCH] issue #106: handle JSONARGS modules too. --- ansible_mitogen/planner.py | 2 +- ansible_mitogen/runner.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible_mitogen/planner.py b/ansible_mitogen/planner.py index ae632ab9..e7b553c6 100644 --- a/ansible_mitogen/planner.py +++ b/ansible_mitogen/planner.py @@ -272,7 +272,7 @@ _planners = [ BinaryPlanner, # ReplacerPlanner, NewStylePlanner, - # JsonArgsPlanner, + JsonArgsPlanner, WantJsonPlanner, OldStylePlanner, ] diff --git a/ansible_mitogen/runner.py b/ansible_mitogen/runner.py index d6b3d48d..a6b77977 100644 --- a/ansible_mitogen/runner.py +++ b/ansible_mitogen/runner.py @@ -342,15 +342,15 @@ class NewStyleRunner(ScriptRunner): } -class JsonArgsFileRunner(ArgsFileRunner, ScriptRunner): +class JsonArgsRunner(ScriptRunner): JSON_ARGS = '<>' def _get_args_contents(self): - return json.dump(self.args) + return json.dumps(self.args) def _rewrite_source(self, s): return ( - super(JsonArgsFileRunner, self)._rewrite_source(s) + super(JsonArgsRunner, self)._rewrite_source(s) .replace(self.JSON_ARGS, self._get_args_contents()) )