From b93de25204b46ee4321c5977ba01e9b816ed0bf2 Mon Sep 17 00:00:00 2001 From: jctanner Date: Thu, 15 Sep 2016 16:41:11 -0400 Subject: [PATCH] During initial argument evaluation, cast args to string. (#17595) Later in the stack, further code will check and inform the user that var names must start with a letter or underscore, so this fix only allows us to get to that previously existing policy. Fixes #16008 --- lib/ansible/parsing/mod_args.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/parsing/mod_args.py b/lib/ansible/parsing/mod_args.py index a311156ae9..fa4cec3d6c 100644 --- a/lib/ansible/parsing/mod_args.py +++ b/lib/ansible/parsing/mod_args.py @@ -22,6 +22,7 @@ __metaclass__ = type from ansible.compat.six import iteritems, string_types from ansible.errors import AnsibleParserError,AnsibleError +from ansible.module_utils._text import to_text from ansible.plugins import module_loader from ansible.parsing.splitter import parse_kv, split_args from ansible.template import Templar @@ -165,6 +166,7 @@ class ModuleArgsParser: # we don't allow users to set them directy in arguments if args and action not in ('command', 'win_command', 'shell', 'win_shell', 'script', 'raw'): for arg in args: + arg = to_text(arg) if arg.startswith('_ansible_'): raise AnsibleError("invalid parameter specified for action '%s': '%s'" % (action, arg))