Karl G 2 weeks ago committed by GitHub
commit fb17de63b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -104,8 +104,14 @@ class LocalFactCollector(BaseFactCollector):
if sect not in fact:
fact[sect] = {}
for opt in cp.options(sect):
val = cp.get(sect, opt)
fact[sect][opt] = val
try:
val = cp.get(sect, opt)
except configparser.Error as ex:
fact = "error loading facts as ini - please check content: %s (%s)" % (fn, ex)
module.warn(fact)
continue
else:
fact[sect][opt] = val
except Exception as e:
fact = "Failed to convert (%s) to JSON: %s" % (fn, to_text(e))
module.warn(fact)

Loading…
Cancel
Save