diff --git a/lib/fog/xenserver.rb b/lib/fog/xenserver.rb index 0d233061a..3e0a5c194 100644 --- a/lib/fog/xenserver.rb +++ b/lib/fog/xenserver.rb @@ -14,9 +14,10 @@ module Fog class Connection require 'xmlrpc/client' - def initialize(host) + def initialize(host, timeout) @factory = XMLRPC::Client.new(host, '/') @factory.set_parser(NokogiriStreamParser.new) + @factory.timeout = timeout end def authenticate( username, password ) diff --git a/lib/fog/xenserver/compute.rb b/lib/fog/xenserver/compute.rb index ad92a33d3..a521dc2e0 100644 --- a/lib/fog/xenserver/compute.rb +++ b/lib/fog/xenserver/compute.rb @@ -86,7 +86,8 @@ module Fog @username = options[:xenserver_username] @password = options[:xenserver_password] @defaults = options[:xenserver_defaults] || {} - @connection = Fog::XenServer::Connection.new(@host) + @timeout = options[:xenserver_timeout] || 30 + @connection = Fog::XenServer::Connection.new(@host, @timeout) @connection.authenticate(@username, @password) end