From eb478c15b4b8d091c1e2290fc5b20640636d0423 Mon Sep 17 00:00:00 2001
From: Viacheslav <v.gletenko@vyos.io>
Date: Tue, 21 Dec 2021 21:47:38 +0000
Subject: interface: T4056: Fix unexpected delete tc qdisc Traffic-policy rules
 are generated by old Perl code This commit prevents to unexpected override
 this code by python.

---
 python/vyos/ifconfig/interface.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'python')

diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py
index bcb692697..5fdd27828 100755
--- a/python/vyos/ifconfig/interface.py
+++ b/python/vyos/ifconfig/interface.py
@@ -1304,8 +1304,8 @@ class Interface(Control):
             source_if = next(iter(self._config['is_mirror_intf']))
             config = self._config['is_mirror_intf'][source_if].get('mirror', None)
 
-        # Check configuration stored by old perl code before delete T3782
-        if not 'redirect' in self._config:
+        # Check configuration stored by old perl code before delete T3782/T4056
+        if not 'redirect' in self._config and not 'traffic_policy' in self._config:
             # 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 2> /dev/null;'
-- 
cgit v1.2.3