summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJACK <jack9603301@163.com>2021-02-11 15:48:15 +0800
committerGitHub <noreply@github.com>2021-02-11 08:48:15 +0100
commit224fd3638d62acd72a67d324350dedf32ad06b42 (patch)
tree3c8e1484412978b5aac45b8afa9104316e0cbef1 /python
parentee8f20596ba1b0482b5e9ccc7826baae294dbde5 (diff)
downloadvyos-1x-224fd3638d62acd72a67d324350dedf32ad06b42.tar.gz
vyos-1x-224fd3638d62acd72a67d324350dedf32ad06b42.zip
mirror: T3297: redirect stderr to /dev/null
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig/interface.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py
index 8528c4a81..d9507d816 100644
--- a/python/vyos/ifconfig/interface.py
+++ b/python/vyos/ifconfig/interface.py
@@ -1015,9 +1015,11 @@ class Interface(Control):
source_if = next(iter(self._config['is_mirror_intf']))
config = self._config['is_mirror_intf'][source_if].get('mirror', None)
+ # Please do not clear the 'set $? = 0 '. It's meant to force a return of 0
# Remove existing mirroring rules
- delete_tc_cmd = f'tc qdisc del dev {source_if} handle ffff: ingress; '
- delete_tc_cmd += f'tc qdisc del dev {source_if} handle 1: root prio'
+ delete_tc_cmd = f'tc qdisc del dev {source_if} handle ffff: ingress 2> /dev/null;'
+ delete_tc_cmd += f'tc qdisc del dev {source_if} handle 1: root prio 2> /dev/null;'
+ delete_tc_cmd += 'set $?=0'
self._popen(delete_tc_cmd)
# Bail out early if nothing needs to be configured