From a3aa5d799ece113cf6f97639398e0f9c435a692e Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Mon, 17 Jul 2017 11:15:43 -0400 Subject: [PATCH] Fix nxos_system name-server parsing (#25973) * Fix nxos_system name-server parsing * Introduce lookup_source as a noop, but don't advertise its use --- lib/ansible/modules/network/nxos/nxos_system.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/ansible/modules/network/nxos/nxos_system.py b/lib/ansible/modules/network/nxos/nxos_system.py index 3ca4d71c05..6bc35cf844 100644 --- a/lib/ansible/modules/network/nxos/nxos_system.py +++ b/lib/ansible/modules/network/nxos/nxos_system.py @@ -87,10 +87,6 @@ EXAMPLES = """ nxos_system: state: absent -- name: configure DNS lookup sources - nxos_system: - lookup_source: Management1 - - name: configure name servers nxos_system: name_servers: @@ -251,8 +247,9 @@ def parse_name_servers(config, vrf_config): objects.append({'server': addr, 'vrf': None}) for vrf, cfg in iteritems(vrf_config): - for item in re.findall('ip name-server (\S+)', cfg, re.M): - for addr in match.group(1).split(' '): + vrf_match = re.search('ip name-server (.+)', cfg, re.M) + if vrf_match: + for addr in vrf_match.group(1).split(' '): objects.append({'server': addr, 'vrf': vrf}) return objects @@ -334,7 +331,7 @@ def main(): name_servers=dict(type='list'), system_mtu=dict(type='int'), - + lookup_source=dict(), state=dict(default='present', choices=['present', 'absent']) )