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.
pull/32239/head
Ricardo Carrillo Cruz 7 years ago committed by GitHub
parent d088b7ab93
commit 80c8b99a62

@ -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…
Cancel
Save