1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix issue with ast evaluation of strings

This commit is contained in:
James Cammarata 2013-10-01 09:20:48 -05:00
parent 5b205ae8bd
commit bff47df5ff

View file

@ -117,7 +117,12 @@ class InventoryParser(object):
(k,v) = t.split("=") (k,v) = t.split("=")
except ValueError, e: except ValueError, e:
raise errors.AnsibleError("Invalid ini entry: %s - %s" % (t, str(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) self.groups[active_group_name].add_host(host)
# [southeast:children] # [southeast:children]