ios_mods - added stdout to exception output. Removed to_lines() (#5428)

stdout lines are now available when certain exceptions occur
(Ref ansible/ansible#18241)

Also noticed that to_lines was essentially handled in
lib/ansible/plugins/action/__init__.py -- only difference was
it didn't handle a list.  to_lines() could be removed across
network modules now, but this commit is only for ios_command.

Also adds disconnect() to ios_command that was added
to ios_config in #5247
This commit is contained in:
bdowling 2016-11-07 19:48:43 -06:00 committed by Matt Clay
commit ddd13bf53a
2 changed files with 4 additions and 9 deletions

View file

@ -367,7 +367,7 @@ def main():
except NetworkError:
exc = get_exception()
module.disconnect()
module.fail_json(msg=str(exc))
module.fail_json(msg=str(exc), stdout=exc.kwargs.get('stdout'))
module.disconnect()
module.exit_json(**result)