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:
commit
d74db05b2d
2 changed files with 3 additions and 3 deletions
|
@ -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/)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue