Blame SOURCES/bz1787178-1-fence_vmware_soap-set-timeout-cleanup-tmp-dirs.patch

f53929
From d4d2dd5066b62210a05c1256c6aee39609e3a974 Mon Sep 17 00:00:00 2001
f53929
From: Thanasis Katsios <thkatsios@gmail.com>
f53929
Date: Mon, 1 Nov 2021 12:31:36 +0200
f53929
Subject: [PATCH 1/3] fence_vmware_soap: Use --login-timeout option
f53929
f53929
Fixes issue #446.
f53929
---
f53929
 agents/vmware_soap/fence_vmware_soap.py | 3 ++-
f53929
 1 file changed, 2 insertions(+), 1 deletion(-)
f53929
f53929
diff --git a/agents/vmware_soap/fence_vmware_soap.py b/agents/vmware_soap/fence_vmware_soap.py
f53929
index a7f08b3d6..034695931 100644
f53929
--- a/agents/vmware_soap/fence_vmware_soap.py
f53929
+++ b/agents/vmware_soap/fence_vmware_soap.py
f53929
@@ -57,7 +57,8 @@ def soap_login(options):
f53929
 
f53929
 	try:
f53929
 		headers = {"Content-Type" : "text/xml;charset=UTF-8", "SOAPAction" : "vim25"}
f53929
-		conn = Client(url + "/vimService.wsdl", location=url, transport=RequestsTransport(verify=verify), headers=headers)
f53929
+		login_timeout = int(options["--login-timeout"])
f53929
+		conn = Client(url + "/vimService.wsdl", location=url, transport=RequestsTransport(verify=verify), headers=headers, timeout=login_timeout)
f53929
 
f53929
 		mo_ServiceInstance = Property('ServiceInstance')
f53929
 		mo_ServiceInstance._type = 'ServiceInstance'
f53929
f53929
From 1e8f0d7582c7768149269f8d002d71b2febbdda0 Mon Sep 17 00:00:00 2001
f53929
From: Thanasis Katsios <thkatsios@gmail.com>
f53929
Date: Tue, 2 Nov 2021 16:52:59 +0200
f53929
Subject: [PATCH 2/3] Set timeout to 60s when disable-timeouts is used
f53929
f53929
---
f53929
 agents/vmware_soap/fence_vmware_soap.py | 2 +-
f53929
 1 file changed, 1 insertion(+), 1 deletion(-)
f53929
f53929
diff --git a/agents/vmware_soap/fence_vmware_soap.py b/agents/vmware_soap/fence_vmware_soap.py
f53929
index 034695931..38101352e 100644
f53929
--- a/agents/vmware_soap/fence_vmware_soap.py
f53929
+++ b/agents/vmware_soap/fence_vmware_soap.py
f53929
@@ -57,7 +57,7 @@ def soap_login(options):
f53929
 
f53929
 	try:
f53929
 		headers = {"Content-Type" : "text/xml;charset=UTF-8", "SOAPAction" : "vim25"}
f53929
-		login_timeout = int(options["--login-timeout"])
f53929
+		login_timeout = 60 if "--disable-timeout" in options and options["--disable-timeout"] != "false" else int(options["--login-timeout"])
f53929
 		conn = Client(url + "/vimService.wsdl", location=url, transport=RequestsTransport(verify=verify), headers=headers, timeout=login_timeout)
f53929
 
f53929
 		mo_ServiceInstance = Property('ServiceInstance')
f53929
f53929
From 8094c8a5a06adf0bd891d4fddcc0b72861a0947e Mon Sep 17 00:00:00 2001
f53929
From: Thanasis Katsios <thkatsios@gmail.com>
f53929
Date: Tue, 2 Nov 2021 18:51:02 +0200
f53929
Subject: [PATCH 3/3] Support disable-timeout simplification
f53929
f53929
---
f53929
 agents/vmware_soap/fence_vmware_soap.py | 2 +-
f53929
 1 file changed, 1 insertion(+), 1 deletion(-)
f53929
f53929
diff --git a/agents/vmware_soap/fence_vmware_soap.py b/agents/vmware_soap/fence_vmware_soap.py
f53929
index 38101352e..2cd45e0b3 100644
f53929
--- a/agents/vmware_soap/fence_vmware_soap.py
f53929
+++ b/agents/vmware_soap/fence_vmware_soap.py
f53929
@@ -57,7 +57,7 @@ def soap_login(options):
f53929
 
f53929
 	try:
f53929
 		headers = {"Content-Type" : "text/xml;charset=UTF-8", "SOAPAction" : "vim25"}
f53929
-		login_timeout = 60 if "--disable-timeout" in options and options["--disable-timeout"] != "false" else int(options["--login-timeout"])
f53929
+		login_timeout = int(options["--login-timeout"]) or 60
f53929
 		conn = Client(url + "/vimService.wsdl", location=url, transport=RequestsTransport(verify=verify), headers=headers, timeout=login_timeout)
f53929
 
f53929
 		mo_ServiceInstance = Property('ServiceInstance')