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

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