From ac9dbdeb103a390ab5f199c160949b7af4fb39f9 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Wed, 4 Apr 2018 15:28:38 +0530 Subject: [PATCH] nmcli: check NMClient, NetworkManager availability (#38076) This fix adds check for NMClient, NetworkManager availability while using require_version API. Fixes: #38042 Signed-off-by: Abhijeet Kasurde --- lib/ansible/modules/net_tools/nmcli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/net_tools/nmcli.py b/lib/ansible/modules/net_tools/nmcli.py index 6e204ba026..ad08f8389b 100644 --- a/lib/ansible/modules/net_tools/nmcli.py +++ b/lib/ansible/modules/net_tools/nmcli.py @@ -467,7 +467,7 @@ try: from gi.repository import NetworkManager, NMClient HAVE_NM_CLIENT = True -except ImportError: +except (ImportError, ValueError): HAVE_NM_CLIENT = False from ansible.module_utils.basic import AnsibleModule