summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-22 17:55:30 +0200
committerChristian Poessinger <christian@poessinger.com>2020-04-22 18:27:49 +0200
commitf9fbda14a2559794999f3391e420c70b31e6a343 (patch)
treeb47695b788938677a5343e6ad6e712af5c9782b9 /src/conf_mode
parentcc87303aad1f5b9140ddcd82a9a75df1979b087c (diff)
downloadvyos-1x-f9fbda14a2559794999f3391e420c70b31e6a343.tar.gz
vyos-1x-f9fbda14a2559794999f3391e420c70b31e6a343.zip
vpn: pptp: T2351: migrate to common name-server, wins-server nodes
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/vpn_pptp.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/conf_mode/vpn_pptp.py b/src/conf_mode/vpn_pptp.py
index 653b21161..841c1b375 100755
--- a/src/conf_mode/vpn_pptp.py
+++ b/src/conf_mode/vpn_pptp.py
@@ -62,15 +62,11 @@ def get_config():
pptp = deepcopy(default_pptp)
conf.set_level(base_path)
- for server in ['server-1', 'server-2']:
- if conf.exists(['dns-servers', server]):
- tmp = conf.return_value(['dns-servers', server])
- pptp['dnsv4'].append(tmp)
+ if conf.exists(['name-server']):
+ pptp['dnsv4'] = conf.return_values(['name-server'])
- for server in ['server-1', 'server-2']:
- if conf.exists(['wins-servers', server]):
- tmp = conf.return_value(['wins-servers', server])
- pptp['wins'].append(tmp)
+ if conf.exists(['wins-server']):
+ pptp['wins'] = conf.return_values(['wins-server'])
if conf.exists(['outside-address']):
pptp['outside_addr'] = conf.return_value(['outside-address'])
@@ -243,6 +239,9 @@ def verify(pptp):
if len(pptp['dnsv4']) > 2:
raise ConfigError('Not more then two IPv4 DNS name-servers can be configured')
+ if len(pptp['wins']) > 2:
+ raise ConfigError('Not more then two IPv4 WINS name-servers can be configured')
+
def generate(pptp):
if not pptp: