From bb5ff5e0b968612890791de48e43479b0352c532 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 30 Aug 2019 11:46:19 +0200 Subject: Python/ifconfig: re-work __init__ interface creation --- python/vyos/interfaceconfig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/vyos/interfaceconfig.py b/python/vyos/interfaceconfig.py index c10f76e52..c40912e3c 100644 --- a/python/vyos/interfaceconfig.py +++ b/python/vyos/interfaceconfig.py @@ -35,8 +35,8 @@ class Interface: if not os.path.exists('/sys/class/net/{0}'.format(ifname)): try: - ret = subprocess.check_output( - ['ip link add dev ' + str(ifname) + ' type ' + type], stderr=subprocess.STDOUT, shell=True).decode() + cmd = 'ip link add dev "{}" type "{}"'.format(ifname, type) + self._cmd(cmd) except subprocess.CalledProcessError as e: if self._debug(): self._debug(e) -- cgit v1.2.3