From 9a0a5f2da27c4d7a08a1b82ebf89cabaa5ee98d7 Mon Sep 17 00:00:00 2001 From: Nelvin Driz Date: Tue, 20 Mar 2012 16:52:14 +0800 Subject: [PATCH] [openstack|image] Update Image Service Authentication Options Signed-off-by: Nelvin Driz --- lib/fog/openstack.rb | 1 + lib/fog/openstack/image.rb | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/fog/openstack.rb b/lib/fog/openstack.rb index 5e6e63c41..403d12ae9 100644 --- a/lib/fog/openstack.rb +++ b/lib/fog/openstack.rb @@ -100,6 +100,7 @@ module Fog req_body['auth']['tenantName'] = @openstack_tenant if @openstack_tenant body = retrieve_tokens_v2(connection, req_body, uri) + svc = body['access']['serviceCatalog']. detect{|x| @service_name.include?(x['type']) } identity_svc = body['access']['serviceCatalog']. diff --git a/lib/fog/openstack/image.rb b/lib/fog/openstack/image.rb index a156c4ca9..9e9d015d4 100644 --- a/lib/fog/openstack/image.rb +++ b/lib/fog/openstack/image.rb @@ -94,10 +94,11 @@ module Fog raise ArgumentError, "Missing required arguments: #{missing_credentials.join(', ')}" unless missing_credentials.empty? end - @openstack_auth_uri = URI.parse(options[:openstack_auth_url]) + @openstack_tenant = options[:openstack_tenant] + @openstack_auth_uri = URI.parse(options[:openstack_auth_url]) @openstack_management_url = options[:openstack_management_url] @openstack_must_reauthenticate = false - @openstack_service_name = options[:openstack_service_name] || ['image'] + @openstack_service_name = options[:openstack_service_name] || ['image'] @connection_options = options[:connection_options] || {} @@ -157,6 +158,7 @@ module Fog def authenticate if @openstack_must_reauthenticate || @openstack_auth_token.nil? options = { + :openstack_tenant => @openstack_tenant, :openstack_api_key => @openstack_api_key, :openstack_username => @openstack_username, :openstack_auth_uri => @openstack_auth_uri,