From 1711df3b75dd226bbb2b2592ca3ee5165c311e17 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Mon, 8 Sep 2014 08:44:37 -0500 Subject: [PATCH] Allow complex_args to be None --- lib/ansible/runner/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 4c566f163e..7500eea11e 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -676,6 +676,7 @@ class Runner(object): def _safe_template_complex_args(args, inject): # Ensure the complex args here are a dictionary, but # first template them if they contain a variable + returned_args = args if isinstance(args, basestring): # If the complex_args were evaluated to a dictionary and there are @@ -696,7 +697,7 @@ class Runner(object): returned_args = templated_args # and a final check to make sure the complex args are a dict - if not isinstance(returned_args, dict): + if returned_args is not None and not isinstance(returned_args, dict): raise errors.AnsibleError("args must be a dictionary, received %s" % returned_args) return returned_args