diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-08-30 11:46:19 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-08-30 11:46:19 +0200 |
commit | bb5ff5e0b968612890791de48e43479b0352c532 (patch) | |
tree | 921207a74d801141b17caa7b792cb4bf62b6cc20 | |
parent | 3238a9cc621975c9417885b3f8552585dce594be (diff) | |
download | vyos-1x-bb5ff5e0b968612890791de48e43479b0352c532.tar.gz vyos-1x-bb5ff5e0b968612890791de48e43479b0352c532.zip |
Python/ifconfig: re-work __init__ interface creation
-rw-r--r-- | python/vyos/interfaceconfig.py | 4 |
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) |