1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge pull request #3574 from majewsky/openstack-remove-tenantid-parsing

Fog::OpenStack::Compute: remove assumption about endpoint URL format
This commit is contained in:
Wesley Beary 2015-06-01 11:13:34 -05:00
commit d74db05b2d
2 changed files with 3 additions and 3 deletions

View file

@ -377,7 +377,7 @@ module Fog
'Accept' => 'application/json',
'X-Auth-Token' => @auth_token
}.merge!(params[:headers] || {}),
:path => "#{@path}/#{@tenant_id}/#{params[:path]}",
:path => "#{@path}/#{params[:path]}",
:query => params[:query]
}))
rescue Excon::Errors::Unauthorized => error
@ -438,7 +438,7 @@ module Fog
uri = URI.parse(@openstack_management_url)
@host = uri.host
@path, @tenant_id = uri.path.scan(/(\/.*)\/(.*)/).flatten
@path = uri.path
@path.sub!(/\/$/, '')
unless @path.match(/1\.1|v2/)

View file

@ -16,7 +16,7 @@ module Fog
response = Excon::Response.new
response.status = 200
response.body = {
"flavor_access" => [{ "tenant_id" => @tenant_id.to_s, "flavor_id" => flavor_ref.to_s }]
"flavor_access" => [{ "tenant_id" => Fog::Mock.random_hex(33), "flavor_id" => flavor_ref.to_s }]
}
response
end