summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-pppoe.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-07 08:27:36 +0200
committerGitHub <noreply@github.com>2020-04-07 08:27:36 +0200
commit09ad28b28c9ebd9308cfe9048686b3b0ef9cfd9c (patch)
tree6e7b0971ecd8859cff864b3ebb37f86f8ba288f5 /src/conf_mode/interfaces-pppoe.py
parente0f13b79a669e7fc8cadac8757b2f5fbbf51dc99 (diff)
parent7256810914e6664bf92041dcd7c3daf649ce0001 (diff)
downloadvyos-1x-09ad28b28c9ebd9308cfe9048686b3b0ef9cfd9c.tar.gz
vyos-1x-09ad28b28c9ebd9308cfe9048686b3b0ef9cfd9c.zip
Merge pull request #307 from thomas-mangin/T2226
util: T2226: convert all call to use vyos.util.{popen, cmd, run}
Diffstat (limited to 'src/conf_mode/interfaces-pppoe.py')
-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')