[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>
This commit is contained in:
parent
e459893601
commit
643726860b
2 changed files with 3 additions and 1 deletions
2
changelogs/fragments/nxos_ambiguous_command_check.yaml
Normal file
2
changelogs/fragments/nxos_ambiguous_command_check.yaml
Normal file
|
@ -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…
Reference in a new issue