Clean up iosxr get_config_diff function (#57589)
This fixes an index error issue when running tests on zuul.ansible.com for iosxr. We can fix this by getting the last element in the list. Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
parent
af25274d6a
commit
88a1fc28d8
1 changed files with 2 additions and 2 deletions
|
@ -345,8 +345,8 @@ def get_config_diff(module, running=None, candidate=None):
|
|||
return response
|
||||
elif is_netconf(module):
|
||||
if running and candidate:
|
||||
running_data = running.split("\n", 1)[1].rsplit("\n", 1)[0]
|
||||
candidate_data = candidate.split("\n", 1)[1].rsplit("\n", 1)[0]
|
||||
running_data = running.split("\n", 1)[-1].rsplit("\n", 1)[0]
|
||||
candidate_data = candidate.split("\n", 1)[-1].rsplit("\n", 1)[0]
|
||||
if running_data != candidate_data:
|
||||
d = Differ()
|
||||
diff = list(d.compare(running_data.splitlines(), candidate_data.splitlines()))
|
||||
|
|
Loading…
Reference in a new issue