Skip to content

Commit

Permalink
Fixes loginBanner plucking over eapi transport when loginBanner isn't…
Browse files Browse the repository at this point in the history
… set. (ansible#23363)
  • Loading branch information
calfonso authored Apr 6, 2017
1 parent 990ba90 commit 394cb34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ansible/modules/network/eos/eos_banner.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ def map_config_to_obj(module):
else:
# On EAPI we need to extract the banner text from dict key
# 'loginBanner'
obj['text'] = output[0]['loginBanner'].strip('\n')
if isinstance(output[0], dict) and 'loginBanner' in output[0].keys():
obj['text'] = output[0]['loginBanner'].strip('\n')
obj['state'] = 'present'
return obj

Expand Down
1 change: 1 addition & 0 deletions test/integration/group_vars/eos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ eapi:
password: "{{ eos_eapi_pass | default('admin') }}"
transport: eapi
use_ssl: no
port: 80
authorize: yes

0 comments on commit 394cb34

Please sign in to comment.