mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-06-29 23:49:09 +00:00
network command modules cleanup (#45242)
* Standardize _command modules * Centralize command transformation process * Fix check mode error test
This commit is contained in:
parent
df768914a1
commit
285b927889
11 changed files with 115 additions and 204 deletions
|
|
@ -1,2 +0,0 @@
|
|||
%No Rollback Confirmed Change pending
|
||||
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
|
||||
|
|
@ -107,19 +107,20 @@ class TestIosCommandModule(TestIosModule):
|
|||
set_module_args(dict(commands=commands, wait_for=wait_for, match='all'))
|
||||
self.execute_module(failed=True)
|
||||
|
||||
def test_ios_command_configure_error(self):
|
||||
def test_ios_command_configure_check_warning(self):
|
||||
commands = ['configure terminal']
|
||||
set_module_args({
|
||||
'commands': commands,
|
||||
'_ansible_check_mode': True,
|
||||
})
|
||||
result = self.execute_module(failed=True)
|
||||
result = self.execute_module()
|
||||
self.assertEqual(
|
||||
result['msg'],
|
||||
'ios_command does not support running config mode commands. Please use ios_config instead'
|
||||
result['warnings'],
|
||||
['Only show commands are supported when using check mode, not executing configure terminal'],
|
||||
)
|
||||
|
||||
def test_ios_command_configure_not_error(self):
|
||||
commands = ['configure revert now']
|
||||
def test_ios_command_configure_not_warning(self):
|
||||
commands = ['configure terminal']
|
||||
set_module_args(dict(commands=commands))
|
||||
self.execute_module()
|
||||
result = self.execute_module()
|
||||
self.assertEqual(result['warnings'], [])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue