Commit 1b8d0b68 by Brian Coca

Merge pull request #10158 from bcoca/hosts_better_error

more resilient errors for bad host declarations in play
parents 7ea2aff2 cbbe2f4e
......@@ -128,7 +128,11 @@ class Play(object):
if hosts is None:
raise errors.AnsibleError('hosts declaration is required')
elif isinstance(hosts, list):
hosts = ';'.join(hosts)
try:
hosts = ';'.join(hosts)
except TypeError,e:
raise errors.AnsibleError('improper host declaration: %s' % str(e))
self.serial = str(ds.get('serial', 0))
self.hosts = hosts
self.name = ds.get('name', self.hosts)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment