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:
parent
1251e89e61
commit
0e6a0b3596
2 changed files with 4 additions and 2 deletions
|
@ -14,9 +14,10 @@ module Fog
|
||||||
class Connection
|
class Connection
|
||||||
require 'xmlrpc/client'
|
require 'xmlrpc/client'
|
||||||
|
|
||||||
def initialize(host)
|
def initialize(host, timeout)
|
||||||
@factory = XMLRPC::Client.new(host, '/')
|
@factory = XMLRPC::Client.new(host, '/')
|
||||||
@factory.set_parser(NokogiriStreamParser.new)
|
@factory.set_parser(NokogiriStreamParser.new)
|
||||||
|
@factory.timeout = timeout
|
||||||
end
|
end
|
||||||
|
|
||||||
def authenticate( username, password )
|
def authenticate( username, password )
|
||||||
|
|
|
@ -86,7 +86,8 @@ module Fog
|
||||||
@username = options[:xenserver_username]
|
@username = options[:xenserver_username]
|
||||||
@password = options[:xenserver_password]
|
@password = options[:xenserver_password]
|
||||||
@defaults = options[:xenserver_defaults] || {}
|
@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)
|
@connection.authenticate(@username, @password)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue