From 33374094d143fadeeb59e93490eb489a6007a9c4 Mon Sep 17 00:00:00 2001 From: marouim Date: Wed, 24 Apr 2019 12:34:59 -0400 Subject: [PATCH] Added parsing of LLDP remote port description (#54873) * Added parsing of LLDP remote port description * Removed whitespace on blank line. --- lib/ansible/modules/network/iosxr/iosxr_facts.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ansible/modules/network/iosxr/iosxr_facts.py b/lib/ansible/modules/network/iosxr/iosxr_facts.py index 0e6b866e5e..4cfcf419b2 100644 --- a/lib/ansible/modules/network/iosxr/iosxr_facts.py +++ b/lib/ansible/modules/network/iosxr/iosxr_facts.py @@ -280,6 +280,7 @@ class Interfaces(FactsBase): facts[intf] = list() fact = dict() fact['host'] = self.parse_lldp_host(entry) + fact['remote_description'] = self.parse_lldp_remote_desc(entry) fact['port'] = self.parse_lldp_port(entry) facts[intf].append(fact) return facts @@ -351,6 +352,11 @@ class Interfaces(FactsBase): if match: return match.group(1) + def parse_lldp_remote_desc(self, data): + match = re.search(r'Port Description: (.+)$', data, re.M) + if match: + return match.group(1) + def parse_lldp_host(self, data): match = re.search(r'System Name: (.+)$', data, re.M) if match: