mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
network command modules cleanup (#45242)
* Standardize _command modules * Centralize command transformation process * Fix check mode error test
This commit is contained in:
@@ -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'], [])
|
||||
|
||||
Reference in New Issue
Block a user