From cb2a45d28686c1db6f78a8e93c402342c3ec8428 Mon Sep 17 00:00:00 2001 From: Trishna Guha Date: Tue, 24 Dec 2019 12:13:58 +0530 Subject: [PATCH] fix nxos_hsrp keyerror (#65796) Signed-off-by: Trishna Guha --- lib/ansible/modules/network/nxos/nxos_hsrp.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/modules/network/nxos/nxos_hsrp.py b/lib/ansible/modules/network/nxos/nxos_hsrp.py index 6d21fd4cbfc..a96e4fc3cd3 100644 --- a/lib/ansible/modules/network/nxos/nxos_hsrp.py +++ b/lib/ansible/modules/network/nxos/nxos_hsrp.py @@ -191,6 +191,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):