Blob Blame History Raw
From d4d2dd5066b62210a05c1256c6aee39609e3a974 Mon Sep 17 00:00:00 2001
From: Thanasis Katsios <thkatsios@gmail.com>
Date: Mon, 1 Nov 2021 12:31:36 +0200
Subject: [PATCH 1/3] fence_vmware_soap: Use --login-timeout option

Fixes issue #446.
---
 agents/vmware_soap/fence_vmware_soap.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/agents/vmware_soap/fence_vmware_soap.py b/agents/vmware_soap/fence_vmware_soap.py
index a7f08b3d6..034695931 100644
--- a/agents/vmware_soap/fence_vmware_soap.py
+++ b/agents/vmware_soap/fence_vmware_soap.py
@@ -57,7 +57,8 @@ def soap_login(options):
 
 	try:
 		headers = {"Content-Type" : "text/xml;charset=UTF-8", "SOAPAction" : "vim25"}
-		conn = Client(url + "/vimService.wsdl", location=url, transport=RequestsTransport(verify=verify), headers=headers)
+		login_timeout = int(options["--login-timeout"])
+		conn = Client(url + "/vimService.wsdl", location=url, transport=RequestsTransport(verify=verify), headers=headers, timeout=login_timeout)
 
 		mo_ServiceInstance = Property('ServiceInstance')
 		mo_ServiceInstance._type = 'ServiceInstance'

From 1e8f0d7582c7768149269f8d002d71b2febbdda0 Mon Sep 17 00:00:00 2001
From: Thanasis Katsios <thkatsios@gmail.com>
Date: Tue, 2 Nov 2021 16:52:59 +0200
Subject: [PATCH 2/3] Set timeout to 60s when disable-timeouts is used

---
 agents/vmware_soap/fence_vmware_soap.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/agents/vmware_soap/fence_vmware_soap.py b/agents/vmware_soap/fence_vmware_soap.py
index 034695931..38101352e 100644
--- a/agents/vmware_soap/fence_vmware_soap.py
+++ b/agents/vmware_soap/fence_vmware_soap.py
@@ -57,7 +57,7 @@ def soap_login(options):
 
 	try:
 		headers = {"Content-Type" : "text/xml;charset=UTF-8", "SOAPAction" : "vim25"}
-		login_timeout = int(options["--login-timeout"])
+		login_timeout = 60 if "--disable-timeout" in options and options["--disable-timeout"] != "false" else int(options["--login-timeout"])
 		conn = Client(url + "/vimService.wsdl", location=url, transport=RequestsTransport(verify=verify), headers=headers, timeout=login_timeout)
 
 		mo_ServiceInstance = Property('ServiceInstance')

From 8094c8a5a06adf0bd891d4fddcc0b72861a0947e Mon Sep 17 00:00:00 2001
From: Thanasis Katsios <thkatsios@gmail.com>
Date: Tue, 2 Nov 2021 18:51:02 +0200
Subject: [PATCH 3/3] Support disable-timeout simplification

---
 agents/vmware_soap/fence_vmware_soap.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/agents/vmware_soap/fence_vmware_soap.py b/agents/vmware_soap/fence_vmware_soap.py
index 38101352e..2cd45e0b3 100644
--- a/agents/vmware_soap/fence_vmware_soap.py
+++ b/agents/vmware_soap/fence_vmware_soap.py
@@ -57,7 +57,7 @@ def soap_login(options):
 
 	try:
 		headers = {"Content-Type" : "text/xml;charset=UTF-8", "SOAPAction" : "vim25"}
-		login_timeout = 60 if "--disable-timeout" in options and options["--disable-timeout"] != "false" else int(options["--login-timeout"])
+		login_timeout = int(options["--login-timeout"]) or 60
 		conn = Client(url + "/vimService.wsdl", location=url, transport=RequestsTransport(verify=verify), headers=headers, timeout=login_timeout)
 
 		mo_ServiceInstance = Property('ServiceInstance')