mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-21 20:30:21 -07:00
Handle ip name-server lines containing multiple nameservers (#32235)
In CSR, multiple nameservers are defined in one line, whereas on IOS it's on multiple ones. This change handles both.
This commit is contained in:
parent
d088b7ab93
commit
80c8b99a62
1 changed files with 4 additions and 3 deletions
|
@ -266,12 +266,13 @@ def parse_domain_search(config):
|
||||||
return matches
|
return matches
|
||||||
|
|
||||||
def parse_name_servers(config):
|
def parse_name_servers(config):
|
||||||
match = re.findall('^ip name-server (?:vrf (\S+) )*(\S+)', config, re.M)
|
match = re.findall('^ip name-server (?:vrf (\S+) )*(.*)', config, re.M)
|
||||||
matches = list()
|
matches = list()
|
||||||
for vrf, server in match:
|
for vrf, servers in match:
|
||||||
if not vrf:
|
if not vrf:
|
||||||
vrf = None
|
vrf = None
|
||||||
matches.append({'server': server, 'vrf': vrf})
|
for server in servers.split():
|
||||||
|
matches.append({'server': server, 'vrf': vrf})
|
||||||
return matches
|
return matches
|
||||||
|
|
||||||
def parse_lookup_source(config):
|
def parse_lookup_source(config):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue