From a937a6a66d57ef434e0fa100d439b324990303c0 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 7 Aug 2013 12:49:12 -0400 Subject: [PATCH] now bad ini entries will throw friendlier error Signed-off-by: Brian Coca --- lib/ansible/inventory/ini.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/inventory/ini.py b/lib/ansible/inventory/ini.py index 8cc0c87831..68dd6fa671 100644 --- a/lib/ansible/inventory/ini.py +++ b/lib/ansible/inventory/ini.py @@ -112,7 +112,10 @@ class InventoryParser(object): for t in tokens[1:]: if t.startswith('#'): break - (k,v) = t.split("=") + try: + (k,v) = t.split("=") + except ValueError, e: + raise errors.AnsibleError("Invalid ini entry: %s - %s" % (t, str(e))) host.set_variable(k,v) self.groups[active_group_name].add_host(host)