From a2e61f67d5810d8b33989d6f9980d1f84fe67d54 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Fri, 13 Sep 2019 01:13:41 +0530 Subject: [PATCH] core: Handle empty extra vars in cli (#61831) Fixes: #61497 Signed-off-by: Abhijeet Kasurde --- changelogs/fragments/extra-vars.yml | 2 ++ lib/ansible/parsing/splitter.py | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 changelogs/fragments/extra-vars.yml diff --git a/changelogs/fragments/extra-vars.yml b/changelogs/fragments/extra-vars.yml new file mode 100644 index 0000000000..d44b281a7f --- /dev/null +++ b/changelogs/fragments/extra-vars.yml @@ -0,0 +1,2 @@ +bugfixes: + - Handle empty extra vars in ansible cli (https://github.com/ansible/ansible/issues/61497). diff --git a/lib/ansible/parsing/splitter.py b/lib/ansible/parsing/splitter.py index a5f40197ac..b5209b01ff 100644 --- a/lib/ansible/parsing/splitter.py +++ b/lib/ansible/parsing/splitter.py @@ -60,6 +60,8 @@ def parse_kv(args, check_raw=False): if args is not None: try: vargs = split_args(args) + except IndexError as e: + raise AnsibleParserError("Unable to parse argument string", orig_exc=e) except ValueError as ve: if 'no closing quotation' in str(ve).lower(): raise AnsibleParserError("error parsing argument string, try quoting the entire line.", orig_exc=ve)