1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Added parameter to force request timeout on xen

This commit is contained in:
Paulo Henrique Lopes Ribeiro 2013-12-05 09:42:28 -02:00
parent 1251e89e61
commit 0e6a0b3596
2 changed files with 4 additions and 2 deletions

View file

@ -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 )

View file

@ -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