diff --git a/changelogs/fragments/47300-ios-check_rc.yaml b/changelogs/fragments/47300-ios-check_rc.yaml new file mode 100644 index 00000000000..82453a95262 --- /dev/null +++ b/changelogs/fragments/47300-ios-check_rc.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: + - Fix issue getting output from failed ios commands when ``check_rc=False`` diff --git a/lib/ansible/plugins/cliconf/ios.py b/lib/ansible/plugins/cliconf/ios.py index 9debea94f6f..8c1e64aca5a 100644 --- a/lib/ansible/plugins/cliconf/ios.py +++ b/lib/ansible/plugins/cliconf/ios.py @@ -291,7 +291,7 @@ class Cliconf(CliconfBase): except AnsibleConnectionFailure as e: if check_rc: raise - out = getattr(e, 'err', e) + out = getattr(e, 'err', to_text(e)) responses.append(out)