From 273fb57ea8576e68850e5f5c3e0120e52ff0bcaa Mon Sep 17 00:00:00 2001 From: Sumit Jaiswal Date: Fri, 22 Jun 2018 04:50:46 +0530 Subject: [PATCH] To fix eos_vrf failure when transport method is eapi (#41470) (#41771) * To fix eos_vrf failure when transport method is eapi (#41470) * resolve bug 40930 * resolve bug 40930 * to fix review comments * to fix review comments * reverting the changes based on review (cherry picked from commit c989b62eefd58c33bd8d620c7bce1ebfa9766c7c) * adding changelog for backport --- changelogs/fragments/eos_vrf_failure-fix.yml | 4 ++++ lib/ansible/modules/network/eos/eos_vrf.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/eos_vrf_failure-fix.yml diff --git a/changelogs/fragments/eos_vrf_failure-fix.yml b/changelogs/fragments/eos_vrf_failure-fix.yml new file mode 100644 index 0000000000..f2e0fbc5fc --- /dev/null +++ b/changelogs/fragments/eos_vrf_failure-fix.yml @@ -0,0 +1,4 @@ +--- +bugfixes: + - Changed the output to "text" for "show vrf" command as default "json" output format + with respect to "eapi" transport was failing (https://github.com/ansible/ansible/pull/41470) diff --git a/lib/ansible/modules/network/eos/eos_vrf.py b/lib/ansible/modules/network/eos/eos_vrf.py index c773355c3a..d8c4da85bd 100644 --- a/lib/ansible/modules/network/eos/eos_vrf.py +++ b/lib/ansible/modules/network/eos/eos_vrf.py @@ -189,7 +189,7 @@ def map_obj_to_commands(updates, module): def map_config_to_obj(module): objs = [] - output = run_commands(module, ['show vrf']) + output = run_commands(module, {'command': 'show vrf', 'output': 'text'}) lines = output[0].strip().splitlines()[3:]