Skip to content

Conversation

@stacywsmith
Copy link
Contributor

Ansible 2 doesn't like custom objects in a module's return value, and
after Juniper/py-junos-eznc#638 PyEZ facts are now a custom object rather than a true
dict. Since facts are read-only, we must begin by copying facts into a dict.
Also, since PyEZ facts are now "on-demand", this must be done before closing
the connection. These changes remain backwards compatible with older PyEZ
versions that have older fact gathering code.

Ansible 2 doesn't like custom objects in a module's return value, and
after py-junos-eznc#638 PyEZ facts are now a custom object rather than a true
dict. Since facts are read-only, we must begin by copying facts into a dict.
Also, since PyEZ facts are now "on-demand", this must be done before closing
the connection. These changes remain backwards compatible with older PyEZ
versions that have older fact gathering code.
@stacywsmith stacywsmith requested a review from vnitinv March 2, 2017 16:29
Copy link
Contributor

@vnitinv vnitinv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.
Thanks

@stacywsmith stacywsmith merged commit 1c993cd into Juniper:master Mar 3, 2017
stacywsmith added a commit that referenced this pull request Apr 6, 2017
#224)

After Juniper/py-junos-eznc#638, PyEZ facts are now a custom object
rather than a true dict. In addition, facts are now read-only.

This was partially addressed in #210, but I missed the case
where the `savedir` option is specified to dump the facts into
JSON files. The same fix is also required in this case.
@stacywsmith stacywsmith deleted the pyez-on-demand-facts branch April 10, 2017 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants