From 3a78861cb57925bf04fbf60724f1ac888b2d3288 Mon Sep 17 00:00:00 2001 From: Chris Alfonso Date: Wed, 5 Apr 2017 11:30:40 -0600 Subject: [PATCH] Fixes #23308 ios_banner: KeyError: 'text' on state: absen (#23313) --- lib/ansible/modules/network/ios/ios_banner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/ios/ios_banner.py b/lib/ansible/modules/network/ios/ios_banner.py index a3e136be934..0aff433a00d 100644 --- a/lib/ansible/modules/network/ios/ios_banner.py +++ b/lib/ansible/modules/network/ios/ios_banner.py @@ -92,7 +92,7 @@ def map_obj_to_commands(updates, module): want, have = updates state = module.params['state'] - if state == 'absent' and have['text']: + if state == 'absent' and 'text' in have.keys() and have['text']: commands.append('no banner %s' % module.params['banner']) elif state == 'present':