From 94eac37d30228eb327f242d02bcc1987f7ed6f21 Mon Sep 17 00:00:00 2001 From: Prasanna Santhanam Date: Thu, 23 Feb 2012 18:32:57 +0530 Subject: [PATCH] The HTTPConnection object times out too soon when status is being polled. This depends on python's internal socket implementation. Added an explicit 3m timeout. Test code MUST NOT induce sleeps longer than 3m, instead check status periodically to keep the HTTPConnection alive. reviewed-by: Chirag Jog --- tools/testClient/cloudstackConnection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testClient/cloudstackConnection.py b/tools/testClient/cloudstackConnection.py index 9b2aa155658..4dc90434de7 100644 --- a/tools/testClient/cloudstackConnection.py +++ b/tools/testClient/cloudstackConnection.py @@ -17,7 +17,7 @@ class cloudConnection(object): self.apiKey = apiKey self.securityKey = securityKey self.mgtSvr = mgtSvr - self.connection = httplib.HTTPConnection("%s:%d"%(mgtSvr,port)) + self.connection = httplib.HTTPConnection("%s:%d"%(mgtSvr,port), timeout=180) self.port = port self.logging = logging if port == 8096: @@ -139,4 +139,4 @@ if __name__ == '__main__': xml = '407i-1-407-RS3i-1-407-RS3system1ROOT2011-07-30T14:45:19-0700Runningfalse1CA13kvm-50-2054CentOS 5.5(64-bit) no GUI (KVM)CentOS 5.5(64-bit) no GUI (KVM)false1Small Instance15005121120NetworkFilesystem380203255.255.255.065.19.181.165.19.181.110vlan://65vlan://65GuestDirecttrue06:52:da:00:00:08KVM' conn = cloudConnection(None) - print conn.paraseReturnXML(xml, deployVirtualMachine.deployVirtualMachineResponse()) \ No newline at end of file + print conn.paraseReturnXML(xml, deployVirtualMachine.deployVirtualMachineResponse())