From 7553c42e0930d3b22f3bfc6551c58003c1449767 Mon Sep 17 00:00:00 2001 From: Stanley Karunditu Date: Fri, 27 Oct 2017 08:15:36 -0400 Subject: [PATCH] Fixes #31090. In network parse_cli filter plugin, this change moves the creation of a (#31092) new match(block). It previously only occurred if a new match occurred, but suggest it should occur when an end of a block match is found. --- lib/ansible/plugins/filter/network.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/ansible/plugins/filter/network.py b/lib/ansible/plugins/filter/network.py index 6a53cf5c073..b46c363f14e 100644 --- a/lib/ansible/plugins/filter/network.py +++ b/lib/ansible/plugins/filter/network.py @@ -112,8 +112,6 @@ def parse_cli(output, tmpl): match_end = end_block.match(line) if match_start: - if lines: - blocks.append('\n'.join(lines)) lines = list() lines.append(line) block_started = True @@ -121,6 +119,7 @@ def parse_cli(output, tmpl): elif match_end: if lines: lines.append(line) + blocks.append('\n'.join(lines)) block_started = False elif block_started: