def initialize(options = {:retry_auth => true})
@retries = options[:retries] || 3
@authuser = options[:username] || (raise Exception::MissingArgument, "Must supply a :username")
@authkey = options[:api_key] || (raise Exception::MissingArgument, "Must supply an :api_key")
@auth_url = options[:auth_url] || (raise Exception::MissingArgument, "Must supply an :auth_url")
@authtenant = (options[:authtenant_id])? {:type => "tenantId", :value=>options[:authtenant_id]} : {:type=>"tenantName", :value=>(options[:authtenant_name] || options[:authtenant] || @authuser)}
@auth_method = options[:auth_method] || "password"
@service_name = options[:service_name] || nil
@service_type = options[:service_type] || "compute"
@region = options[:region] || @region = nil
@regions_list = {}
@is_debug = options[:is_debug]
auth_uri=nil
begin
auth_uri=URI.parse(@auth_url)
rescue Exception => e
raise Exception::InvalidArgument, "Invalid :auth_url parameter: #{e.message}"
end
raise Exception::InvalidArgument, "Invalid :auth_url parameter." if auth_uri.nil? or auth_uri.host.nil?
@auth_host = auth_uri.host
@auth_port = auth_uri.port
@auth_scheme = auth_uri.scheme
@auth_path = auth_uri.path
@retry_auth = options[:retry_auth]
@proxy_host = options[:proxy_host]
@proxy_port = options[:proxy_port]
@authok = false
@http = {}
end