diff --git a/lib/fog/openstack.rb b/lib/fog/openstack.rb index afebfd0b8..720799fc9 100644 --- a/lib/fog/openstack.rb +++ b/lib/fog/openstack.rb @@ -79,12 +79,14 @@ module Fog @compute_service_name = options[:openstack_compute_service_name] req_body= { - 'passwordCredentials' => { - 'username' => @openstack_username, - 'password' => @openstack_api_key + 'auth' => { + 'passwordCredentials' => { + 'username' => @openstack_username, + 'password' => @openstack_api_key + } } } - req_body['tenantId'] = @openstack_tenant if @openstack_tenant + req_body['auth']['tenantName'] = @openstack_tenant if @openstack_tenant response = connection.request({ :expects => [200, 204], @@ -96,9 +98,9 @@ module Fog }) body=MultiJson.decode(response.body) - if body['auth']['serviceCatalog'] and body['auth']['serviceCatalog'][@compute_service_name] and body['auth']['serviceCatalog'][@compute_service_name][0] then - mgmt_url = body['auth']['serviceCatalog'][@compute_service_name][0]['publicURL'] - token = body['auth']['token']['id'] + if svc = body['access']['serviceCatalog'].detect{|x| x['name'] == @compute_service_name} + mgmt_url = svc['endpoints'].detect{|x| x['publicURL']}['publicURL'] + token = body['access']['token']['id'] return { :token => token, :server_management_url => mgmt_url diff --git a/lib/fog/openstack/compute.rb b/lib/fog/openstack/compute.rb index 2a4b548a3..d064a8c4f 100644 --- a/lib/fog/openstack/compute.rb +++ b/lib/fog/openstack/compute.rb @@ -186,8 +186,8 @@ module Fog raise Fog::Compute::OpenStack::ServiceUnavailable.new( "OpenStack binding only supports version 1.1") end - # Add tenant - @path += @openstack_tenant if @openstack_tenant + # Add tenant (done by keystone now for 1.1 auth api) + # @path += @openstack_tenant if @openstack_tenant @port = uri.port @scheme = uri.scheme end