summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGomathiselviS <gomathiselvi@gmail.com>2021-06-14 12:42:05 -0400
committerGitHub <noreply@github.com>2021-06-14 16:42:05 +0000
commiteb46eb529a8bcfaeb5a7e736550d7cfb612b02d7 (patch)
tree0f5c70f399b184594d87090d5fba637cb8a5ddec /plugins
parent4b7f5786c0260d43dcdde93e68695a829ab59adb (diff)
downloadvyos-ansible-old-eb46eb529a8bcfaeb5a7e736550d7cfb612b02d7.tar.gz
vyos-ansible-old-eb46eb529a8bcfaeb5a7e736550d7cfb612b02d7.zip
Fix keyerror in firewall_rules when state=overridden (#172)
Fix keyerror in firewall_rules when state=overridden Reviewed-by: https://github.com/apps/ansible-zuul
Diffstat (limited to 'plugins')
-rw-r--r--plugins/module_utils/network/vyos/config/firewall_rules/firewall_rules.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/module_utils/network/vyos/config/firewall_rules/firewall_rules.py b/plugins/module_utils/network/vyos/config/firewall_rules/firewall_rules.py
index ffc642f..fd5a4f5 100644
--- a/plugins/module_utils/network/vyos/config/firewall_rules/firewall_rules.py
+++ b/plugins/module_utils/network/vyos/config/firewall_rules/firewall_rules.py
@@ -779,8 +779,9 @@ class Firewall_rules(ConfigBase):
key = "group"
group = w[attr].get(key) or {}
if group:
- if h and key in h[attr].keys():
- h_group = h[attr].get(key) or {}
+ h_group = {}
+ if h and h.get(attr) and key in h[attr].keys():
+ h_group = h[attr].get(key)
for item, val in iteritems(group):
if val:
if (