fix nxos_hsrp keyerror (#65796)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit cb2a45d286)

Add changelog for nxos_hsrp fix

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
pull/66383/head
Trishna Guha 5 years ago committed by Matt Clay
parent 247c73432e
commit 7769cc82d3

@ -0,0 +1,3 @@
---
bugfixes:
- Fix nxos_hsrp throwing a KeyError for `auth_enc` (https://github.com/ansible/ansible/pull/65796)

@ -196,6 +196,8 @@ def get_hsrp_group(group, interface, module):
try:
body = run_commands(module, [command])[0]
hsrp_table = body['TABLE_grp_detail']['ROW_grp_detail']
if 'sh_keystring_attr' not in hsrp_table:
del hsrp_key['sh_keystring_attr']
if 'unknown enum:' in str(hsrp_table):
hsrp_table = get_hsrp_group_unknown_enum(module, command, hsrp_table)
except (AttributeError, IndexError, TypeError, KeyError):

Loading…
Cancel
Save