diff --git a/lib/ansible/modules/network/f5/bigip_pool.py b/lib/ansible/modules/network/f5/bigip_pool.py index 60f74bd541..04e8c7dfc1 100644 --- a/lib/ansible/modules/network/f5/bigip_pool.py +++ b/lib/ansible/modules/network/f5/bigip_pool.py @@ -296,7 +296,12 @@ from ansible.module_utils.f5_utils import HAS_F5SDK from ansible.module_utils.f5_utils import F5ModuleError from ansible.module_utils.six import iteritems from collections import defaultdict -from netaddr import IPAddress, AddrFormatError + +try: + from netaddr import IPAddress, AddrFormatError + HAS_NETADDR = True +except ImportError: + HAS_NETADDR = False try: from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError @@ -904,6 +909,9 @@ def main(): if not HAS_F5SDK: raise F5ModuleError("The python f5-sdk module is required") + if not HAS_NETADDR: + raise F5ModuleError("The python netaddr module is required") + spec = ArgumentSpec() client = AnsibleF5Client( diff --git a/test/sanity/import/skip.txt b/test/sanity/import/skip.txt index 3fd09581b2..9610985e03 100644 --- a/test/sanity/import/skip.txt +++ b/test/sanity/import/skip.txt @@ -14,7 +14,6 @@ lib/ansible/modules/cloud/webfaction/webfaction_mailbox.py lib/ansible/modules/cloud/webfaction/webfaction_site.py lib/ansible/modules/clustering/consul_acl.py lib/ansible/modules/network/cloudengine/ce_file_copy.py -lib/ansible/modules/network/f5/bigip_pool.py lib/ansible/modules/network/f5/bigip_provision.py lib/ansible/modules/network/f5/bigip_qkview.py lib/ansible/modules/network/f5/bigip_snmp.py