diff options
author | saichint <saichint@cisco.com> | 2018-06-03 22:23:04 -0700 |
---|---|---|
committer | Matt Clay <matt@mystile.com> | 2018-06-04 13:42:03 -0700 |
commit | 74a56f0ca14b662d870c406767cedb9c49608b77 (patch) | |
tree | 2ec868136cefa8cf7b6fe54bf9192811df053d2a | |
parent | e24743ff1998e137ddf53a0e93843b486cb2be82 (diff) | |
download | ansible-74a56f0ca14b662d870c406767cedb9c49608b77.tar.gz |
fix nxos_banner issue (#41026)
(cherry picked from commit b6afb77a8af69fff4f99897e87151cebd6fa40d3)
-rw-r--r-- | lib/ansible/modules/network/nxos/nxos_banner.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/ansible/modules/network/nxos/nxos_banner.py b/lib/ansible/modules/network/nxos/nxos_banner.py index 65bced04a5..5bb235869b 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) |