refactors bigip_firewall_log_profile to use correct patterns (#60014)

doc correction in bigip_pool
changes functions in bigip_message_routing_route
pull/60030/head
Wojciech Wypior 5 years ago committed by Tim Rupp
parent c9a9621a02
commit 2e54ac37b0

@ -308,6 +308,13 @@ class Parameters(AnsibleF5Parameters):
'network_publisher',
'port_misuse',
'description',
'ip_log_publisher',
'ip_rate_limit',
'ip_log_rthb',
'ip_log_shun',
'ip_log_translation_fields',
'port_rate_limit',
'port_log_publisher',
]
updatables = [
@ -378,31 +385,6 @@ class ModuleParameters(Parameters):
"Valid 'maximum_age' must be in range 0 - 4294967295, or 'indefinite'."
)
@property
def ip_intelligence(self):
if self._values['ip_intelligence'] is None:
return None
to_filter = dict(
logPublisher=self.ip_log_publisher,
aggregateRate=self.ip_rate_limit,
logRtbh=self.ip_log_rtbh,
logShun=self.ip_log_shun,
logTranslationFields=self.ip_log_translation_fields
)
result = self._filter_params(to_filter)
return result
@property
def port_misuse(self):
if self._values['port_misuse'] is None:
return None
to_filter = dict(
logPublisher=self.port_log_publisher,
aggregateRate=self.port_rate_limit,
)
result = self._filter_params(to_filter)
return result
@property
def ip_log_rtbh(self):
if self._values['ip_intelligence'] is None:
@ -501,8 +483,6 @@ class Changes(Parameters):
class UsableChanges(Changes):
@property
def ip_intelligence(self):
if self._values['ip_intelligence']:
return self._values['ip_intelligence']
to_filter = dict(
logPublisher=self._values['ip_log_publisher'],
aggregateRate=self._values['ip_rate_limit'],
@ -516,8 +496,6 @@ class UsableChanges(Changes):
@property
def port_misuse(self):
if self._values['port_misuse']:
return self._values['port_misuse']
to_filter = dict(
logPublisher=self._values['port_log_publisher'],
aggregateRate=self._values['port_rate_limit']
@ -528,6 +506,13 @@ class UsableChanges(Changes):
class ReportableChanges(Changes):
returnables = [
'ip_intelligence',
'port_misuse',
'description',
'dos_protection',
]
def _change_rate_limit_value(self, value):
if value == 4294967295:
return 'indefinite'

@ -158,6 +158,7 @@ try:
from library.module_utils.network.f5.common import flatten_boolean
from library.module_utils.network.f5.common import transform_name
from library.module_utils.network.f5.common import f5_argument_spec
from library.module_utils.network.f5.common import is_empty_list
from library.module_utils.network.f5.compare import cmp_str_with_none
from library.module_utils.network.f5.compare import cmp_simple_list
from library.module_utils.network.f5.icontrol import tmos_version
@ -169,6 +170,7 @@ except ImportError:
from ansible.module_utils.network.f5.common import flatten_boolean
from ansible.module_utils.network.f5.common import transform_name
from ansible.module_utils.network.f5.common import f5_argument_spec
from ansible.module_utils.network.f5.common import is_empty_list
from ansible.module_utils.network.f5.compare import cmp_str_with_none
from ansible.module_utils.network.f5.compare import cmp_simple_list
from ansible.module_utils.network.f5.icontrol import tmos_version
@ -216,7 +218,7 @@ class ModuleParameters(Parameters):
def peers(self):
if self._values['peers'] is None:
return None
if len(self._values['peers']) == 1 and self._values['peers'][0] == "":
if is_empty_list(self._values['peers']):
return ""
result = [fq_name(self.partition, peer) for peer in self._values['peers']]
return result

@ -283,7 +283,7 @@ EXAMPLES = r'''
- name: Add metadata to pool
bigip_pool:
state: absent
state: present
name: my-pool
partition: Common
metadata:

Loading…
Cancel
Save