[2.6] Add ambiguous command check as the error message is not persistent on nexus devices (#45342)

* Add ambiguous command check as the error message is not persistent on nexus devices (#45337)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit f18856d0e2)

* changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
pull/45405/merge
Trishna Guha 6 years ago committed by Matt Clay
parent e459893601
commit 643726860b

@ -0,0 +1,2 @@
bugfixes:
- Add ambiguous command check as the error message is not persistent on nexus devices (https://github.com/ansible/ansible/pull/45337).

@ -156,7 +156,7 @@ class Cli:
if network_api == 'cliconf' and out:
for index, resp in enumerate(out):
if 'Invalid command at' in resp and 'json' in resp:
if ('Invalid command at' in resp or 'Ambiguous command at' in resp) and 'json' in resp:
if commands[index]['output'] == 'json':
commands[index]['output'] = 'text'
out = connection.run_commands(commands, check_rc)

Loading…
Cancel
Save