From 9a7be1c6f8deb73070b12baa2332cd26ef17d0cd Mon Sep 17 00:00:00 2001
From: Isaac Freeman <memotype@gmail.com>
Date: Mon, 21 Nov 2016 11:30:05 -0500
Subject: [PATCH] Suppress InsecureRequestWarning when ssl_insecure is given
---
fence/agents/vmware_soap/fence_vmware_soap.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fence/agents/vmware_soap/fence_vmware_soap.py b/fence/agents/vmware_soap/fence_vmware_soap.py
index df84ae5..93f9658 100644
--- a/fence/agents/vmware_soap/fence_vmware_soap.py
+++ b/fence/agents/vmware_soap/fence_vmware_soap.py
@@ -42,6 +42,8 @@ def soap_login(options):
if options.has_key("--ssl") or options.has_key("--ssl-secure") or options.has_key("--ssl-insecure"):
if options.has_key("--ssl-insecure"):
+ from requests.packages.urllib3.exceptions import InsecureRequestWarning
+ requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
verify = False
else:
verify = True