summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-09-13 11:07:20 +0200
committerChristian Breunig <christian@breunig.cc>2025-09-13 11:07:20 +0200
commit00c39cd1e9b4838fb51b48a62c434bc10f25a531 (patch)
tree08c254cc374c2b774a591cb8953b818b8ec42b75 /python
parent6a47b699577904eb3e5866c27ab2813058cc9ed9 (diff)
downloadvyos-1x-00c39cd1e9b4838fb51b48a62c434bc10f25a531.tar.gz
vyos-1x-00c39cd1e9b4838fb51b48a62c434bc10f25a531.zip
vyos.ifconfig: T7814: suppress unnecessary syslog noise from missing nftables rules
When tearing down interfaces without VRF bindings, nftables may attempt to remove non-existent rules. This results in repetitive error messages in syslog, e.g.: Sep 13 10:27:59 python3[90301]: DEBUG/IFCONFIG returned (err): Sep 13 10:27:59 Error[90301]: Could not process rule: No such file or directory Sep 13 10:27:59 python3[90301]: delete element inet vrf_zones ct_iface_map { "eth1.1337" } Sep 13 10:27:59 python3[90301]: Such output is noise and provides no operational value. The rule removal logic has been adjusted to silently ignore errors when the interface or rule is already absent, ensuring nftables cleanup proceeds when needed while keeping syslogs clean and meaningful.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig/interface.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py
index 3b3536301..8101fdcc3 100644
--- a/python/vyos/ifconfig/interface.py
+++ b/python/vyos/ifconfig/interface.py
@@ -416,7 +416,7 @@ class Interface(Control):
def _nft_check_and_run(self, nft_command):
# Check if deleting is possible first to avoid raising errors
- _, err = self._popen(f'nft --check {nft_command}')
+ _, err = self._popen(f'nft --check {nft_command} 2>/dev/null')
if not err:
# Remove map element
self._cmd(f'nft {nft_command}')