summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Mangin <thomas.mangin@exa.net.uk>2020-04-05 17:20:26 +0100
committerThomas Mangin <thomas.mangin@exa.net.uk>2020-04-06 20:22:35 +0100
commit1aac8325237b78980721e5f44ab2b9ad81ab7055 (patch)
tree03cd58dcbdb75cd18153da1474137adeecf7ad3a
parentd5cb5352a6dd82cdd7b1d20718c92afb1ff31f28 (diff)
downloadvyos-1x-1aac8325237b78980721e5f44ab2b9ad81ab7055.tar.gz
vyos-1x-1aac8325237b78980721e5f44ab2b9ad81ab7055.zip
util: T2226: rewrite pppoe to use cmd
-rwxr-xr-xsrc/conf_mode/interfaces-pppoe.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/conf_mode/interfaces-pppoe.py b/src/conf_mode/interfaces-pppoe.py
index a396af4ea..407547175 100755
--- a/src/conf_mode/interfaces-pppoe.py
+++ b/src/conf_mode/interfaces-pppoe.py
@@ -24,7 +24,7 @@ from netifaces import interfaces
from vyos.config import Config
from vyos.defaults import directories as vyos_data_dir
from vyos.ifconfig import Interface
-from vyos.util import chown_file, chmod_x, subprocess_cmd
+from vyos.util import chown_file, chmod_x, cmd
from vyos import ConfigError
default_config_data = {
@@ -182,8 +182,7 @@ def generate(pppoe):
os.mkdir(dirname)
# Always hang-up PPPoE connection prior generating new configuration file
- cmd = f'systemctl stop ppp@{intf}.service'
- subprocess_cmd(cmd)
+ cmd(f'systemctl stop ppp@{intf}.service')
if pppoe['deleted']:
# Delete PPP configuration files
@@ -238,8 +237,7 @@ def apply(pppoe):
if not pppoe['disable']:
# "dial" PPPoE connection
intf = pppoe['intf']
- cmd = f'systemctl start ppp@{intf}.service'
- subprocess_cmd(cmd)
+ cmd(f'systemctl start ppp@{intf}.service')
# make logfile owned by root / vyattacfg
chown_file(pppoe['logfile'], 'root', 'vyattacfg')