[openstack] Fix Authentication as well as Fog::JSON call bugs
Signed-off-by: Nelvin Driz <nelvindriz@live.com>
This commit is contained in:
parent
d084c7f364
commit
530d860a04
|
@ -43,4 +43,4 @@ module Fog
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -115,7 +115,7 @@ module Fog
|
||||||
:method => 'GET'
|
:method => 'GET'
|
||||||
})
|
})
|
||||||
|
|
||||||
body = MultiJson.decode(response.body)
|
body = Fog::JSON.decode(response.body)
|
||||||
req_body['auth']['tenantName'] = body['tenants'].first['name']
|
req_body['auth']['tenantName'] = body['tenants'].first['name']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ module Fog
|
||||||
response = connection.request({
|
response = connection.request({
|
||||||
:expects => [200, 204],
|
:expects => [200, 204],
|
||||||
:headers => {'Content-Type' => 'application/json'},
|
:headers => {'Content-Type' => 'application/json'},
|
||||||
:body => Fog::JSON.encode(req_body),
|
:body => Fog::JSON.encode(request_body),
|
||||||
:host => uri.host,
|
:host => uri.host,
|
||||||
:method => 'POST',
|
:method => 'POST',
|
||||||
:path => (uri.path and not uri.path.empty?) ? uri.path : 'v2.0'
|
:path => (uri.path and not uri.path.empty?) ? uri.path : 'v2.0'
|
||||||
|
|
|
@ -69,7 +69,6 @@ module Fog
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize(options={})
|
def initialize(options={})
|
||||||
require 'multi_json'
|
|
||||||
@openstack_username = options[:openstack_username]
|
@openstack_username = options[:openstack_username]
|
||||||
|
|
||||||
@data ||= { :users => {}}
|
@data ||= { :users => {}}
|
||||||
|
@ -107,8 +106,6 @@ module Fog
|
||||||
attr_reader :current_tenant
|
attr_reader :current_tenant
|
||||||
|
|
||||||
def initialize(options={})
|
def initialize(options={})
|
||||||
require 'multi_json'
|
|
||||||
|
|
||||||
@openstack_auth_token = options[:openstack_auth_token]
|
@openstack_auth_token = options[:openstack_auth_token]
|
||||||
|
|
||||||
unless @openstack_auth_token
|
unless @openstack_auth_token
|
||||||
|
|
Loading…
Reference in New Issue