From b6afb77a8af69fff4f99897e87151cebd6fa40d3 Mon Sep 17 00:00:00 2001 From: saichint Date: Sun, 3 Jun 2018 22:23:04 -0700 Subject: [PATCH] fix nxos_banner issue (#41026) --- lib/ansible/modules/network/nxos/nxos_banner.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/nxos/nxos_banner.py b/lib/ansible/modules/network/nxos/nxos_banner.py index 65bced04a57..5bb235869b0 100644 --- a/lib/ansible/modules/network/nxos/nxos_banner.py +++ b/lib/ansible/modules/network/nxos/nxos_banner.py @@ -197,7 +197,17 @@ def main(): if commands: if not module.check_mode: - load_config(module, commands) + msgs = load_config(module, commands, True) + if msgs: + for item in msgs: + if item: + if isinstance(item, dict): + err_str = item['clierror'] + else: + err_str = item + if 'more than 40 lines' in err_str or 'buffer overflowed' in err_str: + load_config(module, commands) + result['changed'] = True module.exit_json(**result)