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

Merge pull request #8818 from Erethon/devel

Handle exceptions during config file parsing
This commit is contained in:
James Cammarata 2014-09-02 11:24:10 -05:00
commit f44957de5c

View file

@ -71,7 +71,11 @@ def load_config_file():
for path in [path0, path1, path2, path3]: for path in [path0, path1, path2, path3]:
if path is not None and os.path.exists(path): if path is not None and os.path.exists(path):
try:
p.read(path) p.read(path)
except ConfigParser.Error as e:
print "Error reading config file: \n%s" % e
sys.exit(1)
return p return p
return None return None