fix nxos output truncated issue and nxos_banner issue (#40962)

* fix nxos output truncated issue

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* add changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* fix nxos_banner issue (#41026)

(cherry picked from commit b6afb77a8a)

* add changelog for nxos_banner fix

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
pull/41276/head
Trishna Guha 7 years ago committed by Matt Davis
parent 60ab7b2807
commit ebc36eed8c

@ -0,0 +1,2 @@
bugfixes:
- Fix nxos_banner issue (https://github.com/ansible/ansible/pull/41026).

@ -0,0 +1,2 @@
bugfixes:
- Fix nxos output truncate for upgrade (https://github.com/ansible/ansible/pull/40960).

@ -199,7 +199,17 @@ def main():
if commands:
if not module.check_mode:
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)

@ -30,7 +30,7 @@ from ansible.module_utils._text import to_bytes, to_text
class TerminalModule(TerminalBase):
terminal_stdout_re = [
re.compile(br'[\r\n]?(?!\s*<)?(\x1b\S+)*[a-zA-Z_0-9]{1}[a-zA-Z0-9-_.]*[>|#|%](?:\s*)*(\x1b\S+)*$'),
re.compile(br'[\r\n]?(?!\s*<)?(\x1b\S+)*[a-zA-Z_0-9]{1}[a-zA-Z0-9-_.]*[>|#](?:\s*)*(\x1b\S+)*$'),
re.compile(br'[\r\n]?[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*\(.+\)#(?:\s*)$')
]

Loading…
Cancel
Save