summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorOleksandr Kuchmystyi <o.kuchmystyi@vyos.io>2025-11-28 15:23:58 +0300
committerOleksandr Kuchmystyi <o.kuchmystyi@vyos.io>2025-11-28 15:23:58 +0300
commite1fd60f8e46965830cecd1932ac3d2039300b6a7 (patch)
treec504ccceb26dc36b026b21a892d5646ebd807a2f /python
parent81eb7510621b3aa478359117733204bc7f140931 (diff)
downloadvyos-1x-e1fd60f8e46965830cecd1932ac3d2039300b6a7.tar.gz
vyos-1x-e1fd60f8e46965830cecd1932ac3d2039300b6a7.zip
ipsec: T8001: Commit fails removing VTI interface in IPsec config
Fix cases where commit or IPsec up/down hooks fail if the VTI interface has already been deleted or the `/tmp/ipsec_vti_interfaces` file does not exist. Changes: - Return empty dict from `get_interface_config()` if it returns None to avoid TypeError when accessing 'operstate' (vti_updown_db.py). - Use `open_vti_updown_db_for_create_or_update()` in `vti‑up‑down` script so the temporary interface tracking file is created automatically when missing.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/utils/vti_updown_db.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/vyos/utils/vti_updown_db.py b/python/vyos/utils/vti_updown_db.py
index f4dd24007..0587b48e8 100644
--- a/python/vyos/utils/vti_updown_db.py
+++ b/python/vyos/utils/vti_updown_db.py
@@ -173,7 +173,7 @@ class VTIUpDownDB:
self._fileHandle.truncate()
for interface in self._ifsDown:
- vti_link = get_interface_config(interface)
+ vti_link = get_interface_config(interface) or {}
vti_link_up = (vti_link['operstate'] != 'DOWN' if 'operstate' in vti_link else False)
if vti_link_up:
call(f'sudo ip link set {interface} down')
@@ -182,7 +182,7 @@ class VTIUpDownDB:
self._ifsDown.clear()
for interface in self._ifsUp:
- vti_link = get_interface_config(interface)
+ vti_link = get_interface_config(interface) or {}
vti_link_up = (vti_link['operstate'] != 'DOWN' if 'operstate' in vti_link else False)
if not vti_link_up:
vti = interface_dict_supplier(interface)