mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
nxos_system parse name_servers fix (#29944)
* nxos_system parse name_servers fix Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * fix nxos_system tests Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
parent
68aeaa58a8
commit
5b1c91bf19
3 changed files with 4 additions and 4 deletions
|
@ -238,12 +238,14 @@ def parse_domain_search(config, vrf_config):
|
|||
|
||||
return objects
|
||||
|
||||
def parse_name_servers(config, vrf_config):
|
||||
def parse_name_servers(config, vrf_config, vrfs):
|
||||
objects = list()
|
||||
|
||||
match = re.search('^ip name-server (.+)$', config, re.M)
|
||||
if match:
|
||||
for addr in match.group(1).split(' '):
|
||||
if addr == 'use-vrf' or addr in vrfs:
|
||||
continue
|
||||
objects.append({'server': addr, 'vrf': None})
|
||||
|
||||
for vrf, cfg in iteritems(vrf_config):
|
||||
|
@ -275,7 +277,7 @@ def map_config_to_obj(module):
|
|||
'domain_lookup': 'no ip domain-lookup' not in config,
|
||||
'domain_name': parse_domain_name(config, vrf_config),
|
||||
'domain_search': parse_domain_search(config, vrf_config),
|
||||
'name_servers': parse_name_servers(config, vrf_config),
|
||||
'name_servers': parse_name_servers(config, vrf_config, vrfs),
|
||||
'system_mtu': parse_system_mtu(config)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue