[openstack] Fix Authentication as well as Fog::JSON call bugs

Signed-off-by: Nelvin Driz <nelvindriz@live.com>
This commit is contained in:
Nelvin Driz 2012-04-26 00:42:42 +08:00
parent d084c7f364
commit 530d860a04
3 changed files with 3 additions and 6 deletions

View File

@ -43,4 +43,4 @@ module Fog
end
end
end

View File

@ -115,7 +115,7 @@ module Fog
:method => 'GET'
})
body = MultiJson.decode(response.body)
body = Fog::JSON.decode(response.body)
req_body['auth']['tenantName'] = body['tenants'].first['name']
end
@ -147,7 +147,7 @@ module Fog
response = connection.request({
:expects => [200, 204],
:headers => {'Content-Type' => 'application/json'},
:body => Fog::JSON.encode(req_body),
:body => Fog::JSON.encode(request_body),
:host => uri.host,
:method => 'POST',
:path => (uri.path and not uri.path.empty?) ? uri.path : 'v2.0'

View File

@ -69,7 +69,6 @@ module Fog
end
def initialize(options={})
require 'multi_json'
@openstack_username = options[:openstack_username]
@data ||= { :users => {}}
@ -107,8 +106,6 @@ module Fog
attr_reader :current_tenant
def initialize(options={})
require 'multi_json'
@openstack_auth_token = options[:openstack_auth_token]
unless @openstack_auth_token