summaryrefslogtreecommitdiff
path: root/src/conf_mode/vpn_l2tp.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-22 19:02:18 +0200
committerChristian Poessinger <christian@poessinger.com>2020-04-22 19:02:18 +0200
commit2703915afb9a6bf266adc8834ab01ef721c03424 (patch)
tree6314ea4f1861bae76ecdc8465e23f96883c30334 /src/conf_mode/vpn_l2tp.py
parentd2477601a6c4f5f11773493cacfdc54e5f9a01ae (diff)
parent6f090e918bae878463aa683511ceab4fbbbade54 (diff)
downloadvyos-1x-2703915afb9a6bf266adc8834ab01ef721c03424.tar.gz
vyos-1x-2703915afb9a6bf266adc8834ab01ef721c03424.zip
Merge branch 'pptp-rewrite' of github.com:c-po/vyos-1x into current
* 'pptp-rewrite' of github.com:c-po/vyos-1x: accel-ppp: fix wrong reference in verify() on missing attributes accel-ppp: T2314: bugfix wrong placement of endif in Jinja2 template vpn: pptp: T2351: add support for common radius-additions XML vpn: pptp: T2351: migrate to common radius CLI vpn: pptp: T2351: migrate to common name-server, wins-server nodes accel-ppp: provide common wins-server include definition vpn: pptp: T2351: use first IP from client pool as gateway address vpn: pptp: T2351: align configuration to other accel implementations vpn: pptp: T2351: migrate from SysVinit to systemd vyos.util: migrate all cpu_count() occurances to common get_half_cpus()
Diffstat (limited to 'src/conf_mode/vpn_l2tp.py')
-rwxr-xr-xsrc/conf_mode/vpn_l2tp.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/conf_mode/vpn_l2tp.py b/src/conf_mode/vpn_l2tp.py
index a640e2a94..a4ef99d45 100755
--- a/src/conf_mode/vpn_l2tp.py
+++ b/src/conf_mode/vpn_l2tp.py
@@ -25,7 +25,7 @@ from time import sleep
from ipaddress import ip_network
from vyos.config import Config
-from vyos.util import call
+from vyos.util import call, get_half_cpus
from vyos.validate import is_ipv4
from vyos import ConfigError
from vyos.template import render
@@ -65,7 +65,7 @@ default_config_data = {
'radius_dynamic_author': '',
'wins': [],
'ip6_column': [],
- 'thread_cnt': 1
+ 'thread_cnt': get_half_cpus()
}
def get_config():
@@ -77,10 +77,6 @@ def get_config():
conf.set_level(base_path)
l2tp = deepcopy(default_config_data)
- cpu = os.cpu_count()
- if cpu > 1:
- l2tp['thread_cnt'] = int(cpu/2)
-
### general options ###
if conf.exists(['name-server']):
for name_server in conf.return_values(['name-server']):
@@ -313,7 +309,7 @@ def verify(l2tp):
for radius in l2tp['radius_server']:
if not radius['key']:
- raise ConfigError(f"Missing RADIUS secret for server {{ radius['key'] }}")
+ raise ConfigError(f"Missing RADIUS secret for server { radius['key'] }")
# check for the existence of a client ip pool
if not (l2tp['client_ip_pool'] or l2tp['client_ip_subnets']):