more resilient errors for bad host declarations in play
should fix #10148
This commit is contained in:
parent
4198b0a9a5
commit
cbbe2f4e26
1 changed files with 5 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue