mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Remove sdk and deprecated features (#48016)
This removes deprecated params and the f5-sdk from the sys_global module
This commit is contained in:
@@ -14,9 +14,6 @@ from nose.plugins.skip import SkipTest
|
||||
if sys.version_info < (2, 7):
|
||||
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
||||
|
||||
from units.compat import unittest
|
||||
from units.compat.mock import Mock
|
||||
from units.compat.mock import patch
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
try:
|
||||
@@ -24,17 +21,25 @@ try:
|
||||
from library.modules.bigip_sys_global import ModuleParameters
|
||||
from library.modules.bigip_sys_global import ModuleManager
|
||||
from library.modules.bigip_sys_global import ArgumentSpec
|
||||
from library.module_utils.network.f5.common import F5ModuleError
|
||||
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||
from test.unit.modules.utils import set_module_args
|
||||
|
||||
# In Ansible 2.8, Ansible changed import paths.
|
||||
from test.units.compat import unittest
|
||||
from test.units.compat.mock import Mock
|
||||
from test.units.compat.mock import patch
|
||||
|
||||
from test.units.modules.utils import set_module_args
|
||||
except ImportError:
|
||||
try:
|
||||
from ansible.modules.network.f5.bigip_sys_global import ApiParameters
|
||||
from ansible.modules.network.f5.bigip_sys_global import ModuleParameters
|
||||
from ansible.modules.network.f5.bigip_sys_global import ModuleManager
|
||||
from ansible.modules.network.f5.bigip_sys_global import ArgumentSpec
|
||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||
|
||||
# Ansible 2.8 imports
|
||||
from units.compat import unittest
|
||||
from units.compat.mock import Mock
|
||||
from units.compat.mock import patch
|
||||
|
||||
from units.modules.utils import set_module_args
|
||||
except ImportError:
|
||||
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
||||
@@ -76,24 +81,24 @@ class TestParameters(unittest.TestCase):
|
||||
p = ModuleParameters(params=args)
|
||||
assert p.banner_text == 'this is a banner'
|
||||
assert p.console_timeout == 100
|
||||
assert p.gui_setup == 'enabled'
|
||||
assert p.lcd_display == 'enabled'
|
||||
assert p.mgmt_dhcp == 'enabled'
|
||||
assert p.net_reboot == 'enabled'
|
||||
assert p.quiet_boot == 'enabled'
|
||||
assert p.security_banner == 'enabled'
|
||||
assert p.gui_setup == 'yes'
|
||||
assert p.lcd_display == 'yes'
|
||||
assert p.mgmt_dhcp == 'yes'
|
||||
assert p.net_reboot == 'yes'
|
||||
assert p.quiet_boot == 'yes'
|
||||
assert p.security_banner == 'yes'
|
||||
|
||||
def test_api_parameters(self):
|
||||
args = load_fixture('load_sys_global_settings.json')
|
||||
p = ApiParameters(params=args)
|
||||
assert 'Welcome to the BIG-IP Configuration Utility' in p.banner_text
|
||||
assert p.console_timeout == 0
|
||||
assert p.gui_setup == 'disabled'
|
||||
assert p.lcd_display == 'enabled'
|
||||
assert p.mgmt_dhcp == 'enabled'
|
||||
assert p.net_reboot == 'disabled'
|
||||
assert p.quiet_boot == 'enabled'
|
||||
assert p.security_banner == 'enabled'
|
||||
assert p.gui_setup == 'no'
|
||||
assert p.lcd_display == 'yes'
|
||||
assert p.mgmt_dhcp == 'yes'
|
||||
assert p.net_reboot == 'no'
|
||||
assert p.quiet_boot == 'yes'
|
||||
assert p.security_banner == 'yes'
|
||||
|
||||
|
||||
class TestManager(unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user