diff options
| author | Ruben van Dijk <15885455+RubenNL@users.noreply.github.com> | 2025-11-03 14:58:17 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-03 13:58:17 +0000 |
| commit | 1ccb6f9f494a552d1d0004906d0463ddcdf374db (patch) | |
| tree | a975708214dbfe73e78f9d7ee5a31cbd7f6fe6c9 /plugins/module_utils/network | |
| parent | 70630267059f9d90f7c0e7bf444b91d5ad52cecd (diff) | |
| download | vyos.vyos-1ccb6f9f494a552d1d0004906d0463ddcdf374db.tar.gz vyos.vyos-1ccb6f9f494a552d1d0004906d0463ddcdf374db.zip | |
T7964 - Fix edgecase with empty `commands` array. (#439)
* T7964 - Add failing test.
* T7964 - Fix "IndexError: list index out of range".
Diffstat (limited to 'plugins/module_utils/network')
| -rw-r--r-- | plugins/module_utils/network/vyos/config/firewall_global/firewall_global.py | 2 |
1 files changed, 1 insertions, 1 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 16a91d4e..ddb4af80 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 @@ -368,7 +368,7 @@ 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( + if len(commands) > 0 and commands[-1] == cmd + " " + want["name"] + " " + self._grp_type( attr, ): commands.pop() |
