From bff47df5ffd93b28a7da856882bc707d2f1a596a Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Tue, 1 Oct 2013 09:20:48 -0500 Subject: [PATCH] Fix issue with ast evaluation of strings --- lib/ansible/inventory/ini.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/ansible/inventory/ini.py b/lib/ansible/inventory/ini.py index ff1f4ceac6..1cb79ac8cd 100644 --- a/lib/ansible/inventory/ini.py +++ b/lib/ansible/inventory/ini.py @@ -117,7 +117,12 @@ class InventoryParser(object): (k,v) = t.split("=") except ValueError, e: raise errors.AnsibleError("Invalid ini entry: %s - %s" % (t, str(e))) - host.set_variable(k,ast.literal_eval(v)) + try: + host.set_variable(k,ast.literal_eval(v)) + except: + # most likely a string that literal_eval + # doesn't like, so just set it + host.set_variable(k,v) self.groups[active_group_name].add_host(host) # [southeast:children]