-
Couldn't load subscription status.
- Fork 167
Description
It seems that the commit 1c993cd in junos_get_facts introduces a problem. junos_get_facts throws an exception when used with the savedir option. The exception that we see is:
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_gmEUYy/ansible_module_junos_get_facts.py", line 268, in
main()
File "/tmp/ansible_gmEUYy/ansible_module_junos_get_facts.py", line 216, in main
json.dump(dev.facts, factfile)
File "/usr/lib64/python2.7/json/init.py", line 189, in dump
for chunk in iterable:
File "/usr/lib64/python2.7/json/encoder.py", line 442, in _iterencode
o = _default(o)
File "/usr/lib/python2.7/site-packages/jnpr/junos/factory/to_json.py", line 57, in default
obj = super(PyEzJSONEncoder, self).default(obj)
File "/usr/lib64/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
This may be related with the fact that the new m_results['facts'] variable has been introduced but the json dump is still using json.dump(dev.facts , factfile). See #210 and commit 1c993cd
Christoph