mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
nxos_vlan refactor to support non structured output (#43805)
* nxos_vlan refactor to support non structured output Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * unittest fix Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * minor fixes Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * use check_rc Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * address review comment Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * remove additional return statement * address Nate's review Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
vlan 1
|
||||
mode ce
|
||||
state active
|
||||
no shutdown
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"TABLE_vlanbrief": {
|
||||
"ROW_vlanbrief": {
|
||||
"vlanshowbr-vlanid": 16777216,
|
||||
"vlanshowbr-vlanid-utf": 1,
|
||||
"vlanshowbr-vlanname": "default",
|
||||
"vlanshowbr-vlanstate": "active",
|
||||
"vlanshowbr-shutstate": "noshutdown"
|
||||
}
|
||||
},
|
||||
"TABLE_mtuinfo": {
|
||||
"ROW_mtuinfo": {
|
||||
"vlanshowinfo-vlanid": 1,
|
||||
"vlanshowinfo-media-type": "enet",
|
||||
"vlanshowinfo-vlanmode": "ce-vlan"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"TABLE_vlanbriefxbrief": {
|
||||
"ROW_vlanbriefxbrief": {
|
||||
"vlanshowbr-vlanid": 16777216,
|
||||
"vlanshowbr-vlanid-utf": 1,
|
||||
"vlanshowbr-vlanname": "default",
|
||||
"vlanshowbr-vlanstate": "active",
|
||||
"vlanshowbr-shutstate": "noshutdown"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,16 +42,11 @@ class TestNxosVlanModule(TestNxosModule):
|
||||
self.mock_get_config = patch('ansible.modules.network.nxos.nxos_vlan.get_config')
|
||||
self.get_config = self.mock_get_config.start()
|
||||
|
||||
self.mock_get_capabilities = patch('ansible.modules.network.nxos.nxos_vlan.get_capabilities')
|
||||
self.get_capabilities = self.mock_get_capabilities.start()
|
||||
self.get_capabilities.return_value = {'network_api': 'cliconf'}
|
||||
|
||||
def tearDown(self):
|
||||
super(TestNxosVlanModule, self).tearDown()
|
||||
self.mock_run_commands.stop()
|
||||
self.mock_load_config.stop()
|
||||
self.mock_get_config.stop()
|
||||
self.mock_get_capabilities.stop()
|
||||
|
||||
def load_fixtures(self, commands=None, device=''):
|
||||
def load_from_file(*args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user