summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorRuben van Dijk <15885455+RubenNL@users.noreply.github.com>2025-04-23 21:48:40 +0200
committerGitHub <noreply@github.com>2025-04-24 05:48:40 +1000
commit29e8caf907063c2b4c4d2b65861ad595c10c8fb0 (patch)
treea123234938269e5b97f651e1d30eb890de6a9cee /plugins
parentb0b3adfb53e3089b087731986eb8ea8f89dcf17e (diff)
downloadvyos.vyos-main.tar.gz
vyos.vyos-main.zip
T7260 Remove last firewall group member. (#403)HEADmain
Co-authored-by: omnom62 <75066712+omnom62@users.noreply.github.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/module_utils/network/vyos/config/firewall_global/firewall_global.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/module_utils/network/vyos/config/firewall_global/firewall_global.py b/plugins/module_utils/network/vyos/config/firewall_global/firewall_global.py
index e2a25e32..b7bff53e 100644
--- a/plugins/module_utils/network/vyos/config/firewall_global/firewall_global.py
+++ b/plugins/module_utils/network/vyos/config/firewall_global/firewall_global.py
@@ -373,6 +373,8 @@ class Firewall_global(ConfigBase):
)
elif not opr and key in l_set:
if key == "name" and self._is_grp_del(h, want, key):
+ if commands[-1] == cmd + " " + want["name"] + " " + self._grp_type(attr):
+ commands.pop()
commands.append(cmd + " " + want["name"])
continue
if not (h and in_target_not_none(h, key)) and not self._is_grp_del(h, want, "name"):
@@ -435,6 +437,14 @@ class Firewall_global(ConfigBase):
+ " "
+ member[self._get_mem_type(type)],
)
+ elif not opr and not have:
+ commands.append(
+ cmd
+ + " "
+ + name
+ + " "
+ + self._grp_type(type),
+ )
return commands
def _get_mem_type(self, group):