summaryrefslogtreecommitdiff
path: root/src/conf_mode/vpn_pptp.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-21 17:55:08 +0200
committerChristian Poessinger <christian@poessinger.com>2020-04-21 17:55:08 +0200
commit8998b56a92debb423f8bec19e4953059c585b704 (patch)
tree7def78f674d96ad584162ab1347ea6b7fa4b1cd6 /src/conf_mode/vpn_pptp.py
parent3f3efab7812f79e9fe9acffac0222d313344c25c (diff)
downloadvyos-1x-8998b56a92debb423f8bec19e4953059c585b704.tar.gz
vyos-1x-8998b56a92debb423f8bec19e4953059c585b704.zip
vyos.util: migrate all cpu_count() occurances to common get_half_cpus()
Diffstat (limited to 'src/conf_mode/vpn_pptp.py')
-rwxr-xr-xsrc/conf_mode/vpn_pptp.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/conf_mode/vpn_pptp.py b/src/conf_mode/vpn_pptp.py
index 15b80f984..8108a9670 100755
--- a/src/conf_mode/vpn_pptp.py
+++ b/src/conf_mode/vpn_pptp.py
@@ -23,7 +23,7 @@ from time import sleep
from vyos.config import Config
from vyos import ConfigError
-from vyos.util import run
+from vyos.util import run, get_half_cpus
from vyos.template import render
@@ -79,6 +79,7 @@ def get_config():
'wins': [],
'client_ip_pool': '',
'mtu': '1436',
+ 'thread_cnt': get_half_cpus()
}
### general options ###
@@ -206,18 +207,6 @@ def generate(c):
if c == None:
return None
- # accel-cmd reload doesn't work so any change results in a restart of the daemon
- try:
- if os.cpu_count() == 1:
- c['thread_cnt'] = 1
- else:
- c['thread_cnt'] = int(os.cpu_count()/2)
- except KeyError:
- if os.cpu_count() == 1:
- c['thread_cnt'] = 1
- else:
- c['thread_cnt'] = int(os.cpu_count()/2)
-
render(pptp_conf, 'pptp/pptp.config.tmpl', c, trim_blocks=True)
if c['authentication']['local-users']: