Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Sep 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/nxos_ambiguous_command_check.yaml
Original file line number Diff line number Diff line change
@@ -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).
2 changes: 1 addition & 1 deletion lib/ansible/module_utils/network/nxos/nxos.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def run_commands(self, commands, check_rc=True):

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)
Expand Down