1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Deprecate the bigip_asm_policy module (#49574)

Specific import and export modules should be used instead
This commit is contained in:
Tim Rupp 2018-12-05 16:02:16 -08:00 committed by GitHub
parent 9dc36fcaf0
commit 1c3fa2b07f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 15 deletions

View file

@ -9,7 +9,7 @@ __metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'status': ['deprecated'],
'supported_by': 'certified'}
DOCUMENTATION = r'''
@ -19,6 +19,14 @@ short_description: Manage BIG-IP ASM policies
description:
- Manage BIG-IP ASM policies.
version_added: 2.5
deprecated:
removed_in: '2.12'
alternative: bigip_asm_policy_manage
why: >
The bigip_asm_policy module has been split into three new modules to handle import, export and general policy
management. This will allow scalability of the asm policy management as well as ease of maintenance.
Additionally to further reduce the burden of having multiple smaller module F5 has created asm_policy
role in Ansible Galaxy for a more declarative way of ASM policy management.
options:
active:
description:
@ -500,8 +508,17 @@ class BaseManager(object):
changes = self.changes.to_return()
result.update(**changes)
result.update(dict(changed=changed))
self._announce_deprecations(result)
return result
def _announce_deprecations(self, result):
warnings = result.pop('__warnings', [])
for warning in warnings:
self.client.module.deprecate(
msg=warning['msg'],
version=warning['version']
)
def _set_changed_options(self):
changed = {}
for key in Parameters.returnables:

View file

@ -17,12 +17,12 @@ if sys.version_info < (2, 7):
from ansible.module_utils.basic import AnsibleModule
try:
from library.modules.bigip_asm_policy import V1Parameters
from library.modules.bigip_asm_policy import V2Parameters
from library.modules.bigip_asm_policy import ModuleManager
from library.modules.bigip_asm_policy import V1Manager
from library.modules.bigip_asm_policy import V2Manager
from library.modules.bigip_asm_policy import ArgumentSpec
from library.modules._bigip_asm_policy import V1Parameters
from library.modules._bigip_asm_policy import V2Parameters
from library.modules._bigip_asm_policy import ModuleManager
from library.modules._bigip_asm_policy import V1Manager
from library.modules._bigip_asm_policy import V2Manager
from library.modules._bigip_asm_policy import ArgumentSpec
from library.module_utils.network.f5.common import F5ModuleError
@ -33,12 +33,12 @@ try:
from test.units.modules.utils import set_module_args
except ImportError:
from ansible.modules.network.f5.bigip_asm_policy import V1Parameters
from ansible.modules.network.f5.bigip_asm_policy import V2Parameters
from ansible.modules.network.f5.bigip_asm_policy import ModuleManager
from ansible.modules.network.f5.bigip_asm_policy import V1Manager
from ansible.modules.network.f5.bigip_asm_policy import V2Manager
from ansible.modules.network.f5.bigip_asm_policy import ArgumentSpec
from ansible.modules.network.f5._bigip_asm_policy import V1Parameters
from ansible.modules.network.f5._bigip_asm_policy import V2Parameters
from ansible.modules.network.f5._bigip_asm_policy import ModuleManager
from ansible.modules.network.f5._bigip_asm_policy import V1Manager
from ansible.modules.network.f5._bigip_asm_policy import V2Manager
from ansible.modules.network.f5._bigip_asm_policy import ArgumentSpec
from ansible.module_utils.network.f5.common import F5ModuleError
@ -99,11 +99,11 @@ class TestManager(unittest.TestCase):
self.patcher1.start()
try:
self.p1 = patch('library.modules.bigip_asm_policy.module_provisioned')
self.p1 = patch('library.modules._bigip_asm_policy.module_provisioned')
self.m1 = self.p1.start()
self.m1.return_value = True
except Exception:
self.p1 = patch('ansible.modules.network.f5.bigip_asm_policy.module_provisioned')
self.p1 = patch('ansible.modules.network.f5._bigip_asm_policy.module_provisioned')
self.m1 = self.p1.start()
self.m1.return_value = True