diff --git a/lib/ansible/modules/network/f5/bigip_selfip.py b/lib/ansible/modules/network/f5/bigip_selfip.py index c0172489d1d..2f2bc5f6484 100644 --- a/lib/ansible/modules/network/f5/bigip_selfip.py +++ b/lib/ansible/modules/network/f5/bigip_selfip.py @@ -696,7 +696,7 @@ class ModuleManager(object): elif 'default' in self.want.allow_service: self.want.update(dict(allow_service=['default'])) self._set_changed_options() - if self.want.check_mode: + if self.module.check_mode: return True self.create_on_device() if self.exists(): diff --git a/lib/ansible/modules/network/f5/bigip_virtual_server.py b/lib/ansible/modules/network/f5/bigip_virtual_server.py index 0f130cb3aba..c678a5946fd 100644 --- a/lib/ansible/modules/network/f5/bigip_virtual_server.py +++ b/lib/ansible/modules/network/f5/bigip_virtual_server.py @@ -870,7 +870,6 @@ clone_pools: type: list sample: [{'pool_name':'/Common/Pool1', 'context': 'clientside'}] ''' - import os import re @@ -1772,7 +1771,7 @@ class ModuleParameters(Parameters): if len(result) > 1: pattern = r'^[a-zA-Z0-9_.-]+' matches = re.search(pattern, result[0]) - if matches and not is_valid_ip(matches.group(0)): + if matches and not is_valid_ip(result[0]): # we need to strip RD because when using Virtual Address names the RD is not needed. return None return int(result[1]) @@ -3619,8 +3618,6 @@ def main(): mutually_exclusive=spec.mutually_exclusive ) - client = F5RestClient(**module.params) - try: mm = ModuleManager(module=module) results = mm.exec_module()