From 8998b56a92debb423f8bec19e4953059c585b704 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Tue, 21 Apr 2020 17:55:08 +0200 Subject: vyos.util: migrate all cpu_count() occurances to common get_half_cpus() --- src/conf_mode/service_pppoe-server.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/conf_mode/service_pppoe-server.py') diff --git a/src/conf_mode/service_pppoe-server.py b/src/conf_mode/service_pppoe-server.py index 94eb675f7..066e997f6 100755 --- a/src/conf_mode/service_pppoe-server.py +++ b/src/conf_mode/service_pppoe-server.py @@ -23,7 +23,7 @@ from sys import exit from vyos.config import Config from vyos.template import render -from vyos.util import call +from vyos.util import call, get_half_cpus() from vyos.validate import is_ipv4 from vyos import ConfigError @@ -78,7 +78,7 @@ default_config_data = { 'radius_dynamic_author': '', 'sesscrtl': 'replace', 'snmp': False, - 'thread_cnt': '1' + 'thread_cnt': get_half_cpus() } def get_config(): @@ -90,10 +90,6 @@ def get_config(): conf.set_level(base_path) pppoe = deepcopy(default_config_data) - cpu = os.cpu_count() - if cpu > 1: - pppoe['thread_cnt'] = int(cpu/2) - # general options if conf.exists(['access-concentrator']): pppoe['concentrator'] = conf.return_value(['access-concentrator']) -- cgit v1.2.3