mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 22:51:23 -07:00
fix networking *_command check_mode (#28407)
* Fix check_mode in nxos_command * Fix check_mode for ios_command * fix check_mode for iosxr_command * Fix check_mode in vyos_command * Fix check_mode in eos_command * Fix check_mode in junos_config
This commit is contained in:
parent
96abfde189
commit
e1def05ba2
6 changed files with 29 additions and 19 deletions
|
@ -145,12 +145,13 @@ def parse_commands(module, warnings):
|
|||
), module)
|
||||
commands = command(module.params['commands'])
|
||||
|
||||
for index, item in enumerate(commands):
|
||||
for item in list(commands):
|
||||
if module.check_mode and not item['command'].startswith('show'):
|
||||
warnings.append(
|
||||
'only show commands are supported when using check mode, not '
|
||||
'executing `%s`' % item['command']
|
||||
)
|
||||
commands.remove(item)
|
||||
elif item['command'].startswith('conf'):
|
||||
module.fail_json(
|
||||
msg='iosxr_command does not support running config mode '
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue