From 529df8640ba80eded2ed9671705f3e487f2eee6a Mon Sep 17 00:00:00 2001 From: John R Barker Date: Thu, 6 Apr 2017 10:11:28 +0100 Subject: [PATCH] 'unable to open shell' -> direct to web help (#23267) * 'unable to open shell' -> direct to web help The "unable to open shell" error is returned for a number of different, direct people to online docs (we we can update out of band of releases) to guide them though the various solutions. * fix pep8 errors --- lib/ansible/plugins/action/dellos10.py | 5 ++++- lib/ansible/plugins/action/dellos6.py | 5 ++++- lib/ansible/plugins/action/dellos9.py | 5 ++++- lib/ansible/plugins/action/eos.py | 4 +++- lib/ansible/plugins/action/ios.py | 5 ++++- lib/ansible/plugins/action/iosxr.py | 5 ++++- lib/ansible/plugins/action/nxos.py | 5 ++++- 7 files changed, 27 insertions(+), 7 deletions(-) diff --git a/lib/ansible/plugins/action/dellos10.py b/lib/ansible/plugins/action/dellos10.py index 09a1bdbbbac..c656ad250f6 100644 --- a/lib/ansible/plugins/action/dellos10.py +++ b/lib/ansible/plugins/action/dellos10.py @@ -73,7 +73,10 @@ class ActionModule(_ActionModule): # start the connection if it isn't started rc, out, err = connection.exec_command('open_shell()') if not rc == 0: - return {'failed': True, 'msg': 'unable to open shell', 'rc': rc} + return {'failed': True, + 'msg': 'unable to open shell. Please see: ' + + 'https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell', + 'rc': rc} else: # make sure we are in the right cli context which should be # enable mode and not config module diff --git a/lib/ansible/plugins/action/dellos6.py b/lib/ansible/plugins/action/dellos6.py index 5194aec63e0..a296ccfddf1 100644 --- a/lib/ansible/plugins/action/dellos6.py +++ b/lib/ansible/plugins/action/dellos6.py @@ -69,7 +69,10 @@ class ActionModule(_ActionModule): # start the connection if it isn't started rc, out, err = connection.exec_command('open_shell()') if not rc == 0: - return {'failed': True, 'msg': 'unable to open shell', 'rc': rc} + return {'failed': True, + 'msg': 'unable to open shell. Please see: ' + + 'https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell', + 'rc': rc} else: # make sure we are in the right cli context which should be # enable mode and not config module diff --git a/lib/ansible/plugins/action/dellos9.py b/lib/ansible/plugins/action/dellos9.py index 3567403d0d3..3fff897830e 100644 --- a/lib/ansible/plugins/action/dellos9.py +++ b/lib/ansible/plugins/action/dellos9.py @@ -73,7 +73,10 @@ class ActionModule(_ActionModule): # start the connection if it isn't started rc, out, err = connection.exec_command('open_shell()') if not rc == 0: - return {'failed': True, 'msg': 'unable to open shell', 'rc': rc} + return {'failed': True, + 'msg': 'unable to open shell. Please see: ' + + 'https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell', + 'rc': rc} else: # make sure we are in the right cli context which should be # enable mode and not config module diff --git a/lib/ansible/plugins/action/eos.py b/lib/ansible/plugins/action/eos.py index 327f07cc35e..289edc73e76 100644 --- a/lib/ansible/plugins/action/eos.py +++ b/lib/ansible/plugins/action/eos.py @@ -74,7 +74,9 @@ class ActionModule(_ActionModule): display.vvvv('calling open_shell()', pc.remote_addr) rc, out, err = connection.exec_command('open_shell()') if not rc == 0: - return {'failed': True, 'msg': 'unable to open shell'} + return {'failed': True, + 'msg': 'unable to open shell. Please see: ' + + 'https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell'} else: # make sure we are in the right cli context which should be # enable mode and not config module diff --git a/lib/ansible/plugins/action/ios.py b/lib/ansible/plugins/action/ios.py index fc162cb79cd..976f81f8dd8 100644 --- a/lib/ansible/plugins/action/ios.py +++ b/lib/ansible/plugins/action/ios.py @@ -69,7 +69,10 @@ class ActionModule(_ActionModule): # start the connection if it isn't started rc, out, err = connection.exec_command('open_shell()') if not rc == 0: - return {'failed': True, 'msg': 'unable to open shell', 'rc': rc} + return {'failed': True, + 'msg': 'unable to open shell. Please see: ' + + 'https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell', + 'rc': rc} else: # make sure we are in the right cli context which should be # enable mode and not config module diff --git a/lib/ansible/plugins/action/iosxr.py b/lib/ansible/plugins/action/iosxr.py index f746de09e89..18c88ab6e9e 100644 --- a/lib/ansible/plugins/action/iosxr.py +++ b/lib/ansible/plugins/action/iosxr.py @@ -67,7 +67,10 @@ class ActionModule(_ActionModule): display.vvvv('calling open_shell()', pc.remote_addr) rc, out, err = connection.exec_command('open_shell()') if rc != 0: - return {'failed': True, 'msg': 'unable to open shell', 'rc': rc} + return {'failed': True, + 'msg': 'unable to open shell. Please see: ' + + 'https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell', + 'rc': rc} else: # make sure we are in the right cli context which should be # enable mode and not config module diff --git a/lib/ansible/plugins/action/nxos.py b/lib/ansible/plugins/action/nxos.py index dc2cf5092ca..f23c520a8ee 100644 --- a/lib/ansible/plugins/action/nxos.py +++ b/lib/ansible/plugins/action/nxos.py @@ -74,7 +74,10 @@ class ActionModule(_ActionModule): rc, out, err = connection.exec_command('open_shell()') display.vvvv('open_shell() returned %s %s %s' % (rc, out, err)) if rc != 0: - return {'failed': True, 'msg': 'unable to open shell', 'rc': rc} + return {'failed': True, + 'msg': 'unable to open shell. Please see: ' + + 'https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell', + 'rc': rc} else: # make sure we are in the right cli context which should be # enable mode and not config module