Remove deprecated options from modules (#50246)

* Remove deprecated options from modules

* Update tests

* Add porting guide notes
This commit is contained in:
Nathaniel Case
2019-01-22 09:18:26 -05:00
committed by GitHub
parent 7f2b9a8a31
commit 9702893729
11 changed files with 25 additions and 121 deletions

View File

@@ -199,9 +199,9 @@ class TestEosConfigModule(TestEosModule):
self.assertEqual(self.get_config.call_count, 0)
self.assertEqual(self.load_config.call_count, 0)
def test_eos_config_save(self):
def test_eos_config_save_always(self):
self.run_commands.return_value = "hostname foo"
set_module_args(dict(save=True))
set_module_args(dict(save_when='always'))
self.execute_module(changed=True)
self.assertEqual(self.run_commands.call_count, 1)
self.assertEqual(self.get_config.call_count, 0)

View File

@@ -108,9 +108,9 @@ class TestIosConfigModule(TestIosModule):
self.assertEqual(self.get_config.call_count, 0)
self.assertEqual(self.conn.edit_config.call_count, 0)
def test_ios_config_save(self):
def test_ios_config_save_always(self):
self.run_commands.return_value = "hostname foo"
set_module_args(dict(save=True))
set_module_args(dict(save_when='always'))
self.execute_module(changed=True)
self.assertEqual(self.run_commands.call_count, 1)
self.assertEqual(self.get_config.call_count, 0)

View File

@@ -46,18 +46,18 @@ class TestNxosVrfafModule(TestNxosModule):
self.load_config.return_value = None
def test_nxos_vrf_af_present(self):
set_module_args(dict(vrf='ntc', afi='ipv4', safi='unicast', state='present'))
set_module_args(dict(vrf='ntc', afi='ipv4', state='present'))
result = self.execute_module(changed=True)
self.assertEqual(sorted(result['commands']), sorted(['vrf context ntc',
'address-family ipv4 unicast']))
def test_nxos_vrf_af_absent(self):
set_module_args(dict(vrf='ntc', afi='ipv4', safi='unicast', state='absent'))
set_module_args(dict(vrf='ntc', afi='ipv4', state='absent'))
result = self.execute_module(changed=False)
self.assertEqual(result['commands'], [])
def test_nxos_vrf_af_route_target(self):
set_module_args(dict(vrf='ntc', afi='ipv4', safi='unicast', route_target_both_auto_evpn=True))
set_module_args(dict(vrf='ntc', afi='ipv4', route_target_both_auto_evpn=True))
result = self.execute_module(changed=True)
self.assertEqual(sorted(result['commands']), sorted(['vrf context ntc',
'address-family ipv4 unicast',