From 25bfece386756cbd40b83bc26141edddb0e05c72 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 4 Apr 2020 11:29:37 +0200 Subject: vyos.util: use common subprocess_cmd wrapper --- src/conf_mode/interfaces-pppoe.py | 7 +------ src/conf_mode/interfaces-wirelessmodem.py | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) (limited to 'src/conf_mode') diff --git a/src/conf_mode/interfaces-pppoe.py b/src/conf_mode/interfaces-pppoe.py index 9c045534c..97b0ff0df 100755 --- a/src/conf_mode/interfaces-pppoe.py +++ b/src/conf_mode/interfaces-pppoe.py @@ -19,11 +19,10 @@ import os from sys import exit from copy import deepcopy from jinja2 import Template -from subprocess import Popen, PIPE from vyos.config import Config from vyos.ifconfig import Interface -from vyos.util import chown_file, chmod_x_file +from vyos.util import chown_file, chmod_x_file, subprocess_cmd from vyos import ConfigError from netifaces import interfaces @@ -189,10 +188,6 @@ default_config_data = { 'vrf': '' } -def subprocess_cmd(command): - p = Popen(command, stdout=PIPE, shell=True) - p.communicate() - def get_config(): pppoe = deepcopy(default_config_data) conf = Config() diff --git a/src/conf_mode/interfaces-wirelessmodem.py b/src/conf_mode/interfaces-wirelessmodem.py index bfefa5dd1..7a10b9c43 100755 --- a/src/conf_mode/interfaces-wirelessmodem.py +++ b/src/conf_mode/interfaces-wirelessmodem.py @@ -19,12 +19,11 @@ import os from sys import exit from copy import deepcopy from jinja2 import FileSystemLoader, Environment -from subprocess import Popen, PIPE from netifaces import interfaces from vyos.config import Config -from vyos.util import chown_file, chmod_x_file from vyos.defaults import directories as vyos_data_dir +from vyos.util import chown_file, chmod_x_file, subprocess_cmd from vyos import ConfigError default_config_data = { @@ -45,10 +44,6 @@ default_config_data = { 'vrf': '' } -def subprocess_cmd(command): - p = Popen(command, stdout=PIPE, shell=True) - p.communicate() - def check_kmod(): modules = ['option', 'usb_wwan', 'usbserial'] for module in modules: -- cgit v1.2.3