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
|
||||
|
||||
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()
|
||||
for vrf, server in match:
|
||||
for vrf, servers in match:
|
||||
if not vrf:
|
||||
vrf = None
|
||||
matches.append({'server': server, 'vrf': vrf})
|
||||
for server in servers.split():
|
||||
matches.append({'server': server, 'vrf': vrf})
|
||||
return matches
|
||||
|
||||
def parse_lookup_source(config):
|
||||
|
|
Loading…
Reference in a new issue