From cbbe2f4e263a5eeda6762587bf636edb5335c937 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 3 Feb 2015 10:26:48 -0500 Subject: [PATCH] more resilient errors for bad host declarations in play should fix #10148 --- lib/ansible/playbook/play.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index b551baf6b31..74aa6a9f798 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -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)