diff --git a/lib/ansible/module_utils/splitter.py b/lib/ansible/module_utils/splitter.py index 152fa4782d1..be7555847da 100644 --- a/lib/ansible/module_utils/splitter.py +++ b/lib/ansible/module_utils/splitter.py @@ -70,6 +70,7 @@ def split_args(args): # here we encode the args, so we have a uniform charset to # work with, and split on white space + args = args.strip() try: args = args.encode('utf-8') do_decode = True diff --git a/lib/ansible/utils/__init__.py b/lib/ansible/utils/__init__.py index 19f31140d7a..474dd86f098 100644 --- a/lib/ansible/utils/__init__.py +++ b/lib/ansible/utils/__init__.py @@ -707,7 +707,7 @@ def parse_kv(args): for x in vargs: if "=" in x: k, v = x.split("=",1) - options[k] = unquote(v) + options[k] = unquote(v.strip()) return options def merge_hash(a, b):