issue #106: handle JSONARGS modules too.

pull/193/head
David Wilson 7 years ago
parent 971b366162
commit a98a51a328

@ -272,7 +272,7 @@ _planners = [
BinaryPlanner, BinaryPlanner,
# ReplacerPlanner, # ReplacerPlanner,
NewStylePlanner, NewStylePlanner,
# JsonArgsPlanner, JsonArgsPlanner,
WantJsonPlanner, WantJsonPlanner,
OldStylePlanner, OldStylePlanner,
] ]

@ -342,15 +342,15 @@ class NewStyleRunner(ScriptRunner):
} }
class JsonArgsFileRunner(ArgsFileRunner, ScriptRunner): class JsonArgsRunner(ScriptRunner):
JSON_ARGS = '<<INCLUDE_ANSIBLE_MODULE_JSON_ARGS>>' JSON_ARGS = '<<INCLUDE_ANSIBLE_MODULE_JSON_ARGS>>'
def _get_args_contents(self): def _get_args_contents(self):
return json.dump(self.args) return json.dumps(self.args)
def _rewrite_source(self, s): def _rewrite_source(self, s):
return ( return (
super(JsonArgsFileRunner, self)._rewrite_source(s) super(JsonArgsRunner, self)._rewrite_source(s)
.replace(self.JSON_ARGS, self._get_args_contents()) .replace(self.JSON_ARGS, self._get_args_contents())
) )

Loading…
Cancel
Save