napalm-automation/napalm-ansible

conform diff format with ansible format

fabrepe opened this issue · 0 comments

Ansible allows diff between object before and after module (using --diff flag). Modules, and especially napalm modules can support the ansible's format (see https://blog.networktocode.com/blog/post/generating-diff-with-ansible/#ansible-module-development--how-to-add-diff-support-to-your-module).

It may be pretty easy to implement, by modifying :

module.exit_json(changed=changed, msg=diff)

to

module.exit_json(changed=changed, msg=diff, diff={"prepared": diff})