summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-08-30 11:46:19 +0200
committerChristian Poessinger <christian@poessinger.com>2019-08-30 11:46:19 +0200
commitbb5ff5e0b968612890791de48e43479b0352c532 (patch)
tree921207a74d801141b17caa7b792cb4bf62b6cc20 /python
parent3238a9cc621975c9417885b3f8552585dce594be (diff)
downloadvyos-1x-bb5ff5e0b968612890791de48e43479b0352c532.tar.gz
vyos-1x-bb5ff5e0b968612890791de48e43479b0352c532.zip
Python/ifconfig: re-work __init__ interface creation
Diffstat (limited to 'python')
-rw-r--r--python/vyos/interfaceconfig.py4
1 files 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)