We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d14f242 commit f43c73bCopy full SHA for f43c73b
src/ansiblelint/rules/args.py
@@ -194,10 +194,16 @@ def matchtask(
194
# through `ArgumentSpecValidator` class as in case of modules.
195
return []
196
197
- with patch.object(
198
- sys,
199
- "argv",
200
- ["", json.dumps({"ANSIBLE_MODULE_ARGS": clean_json(module_args)})],
+ buffer = io.BytesIO(
+ json.dumps({
+ "ANSIBLE_MODULE_ARGS": clean_json(module_args)
+ }).encode()
201
+ )
202
+ with (
203
+ patch.object(
204
+ sys, "stdin", io.TextIOWrapper(buffer, encoding="utf-8")
205
+ ),
206
+ patch.object(sys, "argv", [""]),
207
):
208
fio = io.StringIO()
209
failed_msg = ""
0 commit comments