diff options
author | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2025-05-21 14:01:00 +0200 |
---|---|---|
committer | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2025-05-21 14:37:44 +0200 |
commit | 5918dcce154a6a0e44a31b3ff5bf20b625250502 (patch) | |
tree | bef48f48fa8729820c26c5c17986c5c4e63e9485 /python | |
parent | 60a05334688bf4bd3754eab565e0662f0dd3dec4 (diff) | |
download | vyos-1x-5918dcce154a6a0e44a31b3ff5bf20b625250502.tar.gz vyos-1x-5918dcce154a6a0e44a31b3ff5bf20b625250502.zip |
flowtable: T7350: Prevent interface deletion if referenced on flowtable
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/configdict.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index a34b0176a..040eb49ba 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -703,3 +703,18 @@ def get_accel_dict(config, base, chap_secrets, with_pki=False): dict['authentication']['radius']['server'][server]['acct_port'] = '0' return dict + +def get_flowtable_interfaces(config): + """ + Return all interfaces used in flowtables + """ + ft_base = ['firewall', 'flowtable'] + + if not config.exists(ft_base): + return [] + + ifaces = [] + for ft_name in config.list_nodes(ft_base): + ifaces += config.return_values(ft_base + [ft_name, 'interface']) + + return ifaces |