mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00: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:
committed by
Chris Alfonso
parent
96abfde189
commit
e1def05ba2
@@ -163,12 +163,14 @@ def parse_commands(module, warnings):
|
||||
transform = ComplexList(spec, module)
|
||||
commands = transform(module.params['commands'])
|
||||
|
||||
for index, item in enumerate(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']
|
||||
)
|
||||
if module.check_mode:
|
||||
for item in list(commands):
|
||||
if not item['command'].startswith('show'):
|
||||
warnings.append(
|
||||
'Only show commands are supported when using check_mode, not '
|
||||
'executing %s' % item['command']
|
||||
)
|
||||
commands.remove(item)
|
||||
|
||||
return commands
|
||||
|
||||
|
||||
Reference in New Issue
Block a user