lib/rbovirt.rb in rbovirt-0.0.30 vs lib/rbovirt.rb in rbovirt-0.0.31
- old
+ new
@@ -147,15 +147,16 @@
{ :authorization => "Basic " + encoded_credentials }
end
def rest_client(suburl)
if (URI.parse(@api_entrypoint)).scheme == 'https'
- verify_options = {}
- verify_options[:verify_ssl] = ca_no_verify ? OpenSSL::SSL::VERIFY_NONE : OpenSSL::SSL::VERIFY_PEER
- verify_options[:ssl_cert_store] = ca_cert_store if ca_cert_store
- verify_options[:ssl_ca_file] = ca_cert_file if ca_cert_file
+ options = {}
+ options[:verify_ssl] = ca_no_verify ? OpenSSL::SSL::VERIFY_NONE : OpenSSL::SSL::VERIFY_PEER
+ options[:ssl_cert_store] = ca_cert_store if ca_cert_store
+ options[:ssl_ca_file] = ca_cert_file if ca_cert_file
end
- RestClient::Resource.new(@api_entrypoint, verify_options)[suburl]
+ options[:timeout] = ENV['RBOVIRT_REST_TIMEOUT'] if ENV['RBOVIRT_REST_TIMEOUT']
+ RestClient::Resource.new(@api_entrypoint, options)[suburl]
end
def filter_header
filtered_api ? { :filter => "true" } : {}
end