From d3d44a3efaf22c91d342f2cb81470745b7be0658 Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Wed, 18 Feb 2015 18:10:15 +0000 Subject: Set an explicit timeout when fetching CloudStack passwords. --- cloudinit/sources/DataSourceCloudStack.py | 1 + 1 file changed, 1 insertion(+) (limited to 'cloudinit/sources') diff --git a/cloudinit/sources/DataSourceCloudStack.py b/cloudinit/sources/DataSourceCloudStack.py index a8f8daec..89f58e1e 100644 --- a/cloudinit/sources/DataSourceCloudStack.py +++ b/cloudinit/sources/DataSourceCloudStack.py @@ -143,6 +143,7 @@ class DataSourceCloudStack(sources.DataSource): # so we use the socket directly to read off the password. conn = http_client.HTTPConnection(self.vr_addr, 8080) conn.request('GET', '', headers={'DomU_Request': req_string}) + conn.sock.settimeout(30) output = conn.sock.recv(1024).decode('utf-8').strip() conn.close() return output -- cgit v1.2.3