capture error when smoeone puts a list or some other complex type in

delegate_to
This commit is contained in:
Brian Coca 2015-07-17 23:02:29 -04:00
parent 5d1fb380fc
commit 731dbeb712

View file

@ -403,6 +403,9 @@ class Runner(object):
# the hostname was not found in the inventory, so
# we just ignore this and try the next method
pass
except TypeError, e:
# Someone is trying to pass a list or some other 'non string' as a host.
raise errors.AnsibleError("Invalid type for delegate_to: %s" % str(e))
if thisuser is None and self.remote_user:
# user defined by play/runner