From b9b4e682064c429e4a9981bbbf13bbd0173e1b47 Mon Sep 17 00:00:00 2001 From: Ricardo Carrillo Cruz Date: Wed, 5 Apr 2017 21:07:18 +0200 Subject: [PATCH] Check text key exists on eos_banner absent case (#23319) This can fail if we don't check the key exists. --- lib/ansible/modules/network/eos/eos_banner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/eos/eos_banner.py b/lib/ansible/modules/network/eos/eos_banner.py index 62705723a8d..900f7c82657 100644 --- a/lib/ansible/modules/network/eos/eos_banner.py +++ b/lib/ansible/modules/network/eos/eos_banner.py @@ -95,7 +95,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':