From c3e3580baf5db0786fa2e900a0bedb53e121cc92 Mon Sep 17 00:00:00 2001 From: John R Barker Date: Thu, 6 Apr 2017 10:14:42 +0100 Subject: [PATCH] 'unable to open shell' -> direct to web help (#23267) (#23331) * '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 (cherry picked from commit 529df8640ba80eded2ed9671705f3e487f2eee6a) --- 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 09a1bdbbba..c656ad250f 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 5194aec63e..a296ccfddf 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 3567403d0d..3fff897830 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 a2ff383441..2ada66bdf7 100644 --- a/lib/ansible/plugins/action/eos.py +++ b/lib/ansible/plugins/action/eos.py @@ -73,7 +73,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 2a8a532c97..f59cd59855 100644 --- a/lib/ansible/plugins/action/ios.py +++ b/lib/ansible/plugins/action/ios.py @@ -68,7 +68,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 83fb1d2f5b..39da52dac5 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 df03253c0c..fdc9fb6b7f 100644 --- a/lib/ansible/plugins/action/nxos.py +++ b/lib/ansible/plugins/action/nxos.py @@ -73,7 +73,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