From 2091b040ff33e9b2531e9a1fcbd982f3ee9ac380 Mon Sep 17 00:00:00 2001 From: Chad Norgan Date: Fri, 27 Feb 2015 11:19:44 -0600 Subject: [PATCH] Ignore lines that do not have the key in them Some switches return multi-line output, which breaks the split function, the change seeks to only preform the split on a line that has the key. --- lib/ansible/modules/extras/network/lldp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/extras/network/lldp.py b/lib/ansible/modules/extras/network/lldp.py index 6b8836852f6..d30fa5d9a60 100755 --- a/lib/ansible/modules/extras/network/lldp.py +++ b/lib/ansible/modules/extras/network/lldp.py @@ -54,7 +54,7 @@ def gather_lldp(): lldp_entries = output.split("\n") for entry in lldp_entries: - if entry: + if entry.startswith('lldp'): path, value = entry.strip().split("=", 1) path = path.split(".") path_components, final = path[:-1], path[-1]