[2.7] Add ambiguous command check as the error message is not persistent on nexus devices (#45341)
* 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 commitf18856d0e2
) * cli_config module doc update (#45345) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commitd5bfd93e28
)
This commit is contained in:
parent
fdb9c6d5af
commit
351bb3dd9a
3 changed files with 6 additions and 6 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).
|
|
@ -161,7 +161,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)
|
||||
|
|
|
@ -27,7 +27,8 @@ options:
|
|||
description:
|
||||
- The config to be pushed to the network device. This argument
|
||||
is mutually exclusive with C(rollback) and either one of the
|
||||
option should be given as input.
|
||||
option should be given as input. The config should have
|
||||
indentation that the device uses.
|
||||
type: 'str'
|
||||
commit:
|
||||
description:
|
||||
|
@ -120,10 +121,7 @@ EXAMPLES = """
|
|||
|
||||
- name: Use diff_match
|
||||
cli_config:
|
||||
config: |
|
||||
interface loopback999
|
||||
no description
|
||||
shutdown
|
||||
config: "{{ lookup('file', 'interface_config') }}"
|
||||
diff_match: none
|
||||
|
||||
- name: nxos replace config
|
||||
|
|
Loading…
Add table
Reference in a new issue