openstack-compute 1.1.7 → 1.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/openstack/compute/authentication.rb +8 -1
- data/lib/openstack/compute/connection.rb +2 -0
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.8
|
@@ -36,7 +36,14 @@ module Compute
|
|
36
36
|
|
37
37
|
@uri = String.new
|
38
38
|
|
39
|
-
|
39
|
+
if connection.auth_method == "password"
|
40
|
+
auth_data = JSON.generate({ "auth" => { "passwordCredentials" => { "username" => connection.authuser, "password" => connection.authkey }, "tenantName" => connection.authtenant}})
|
41
|
+
elsif connection.auth_method == "rax-kskey"
|
42
|
+
auth_data = JSON.generate({"auth" => {"RAX-KSKEY:apiKeyCredentials" => {"username" => connection.authuser, "apiKey" => connection.authkey}}})
|
43
|
+
else
|
44
|
+
raise Exception::InvalidArgument, "Unrecognized auth method #{connection.auth_method}"
|
45
|
+
end
|
46
|
+
|
40
47
|
response = server.post(connection.auth_path.chomp("/")+"/tokens", auth_data, {'Content-Type' => 'application/json'})
|
41
48
|
if (response.code =~ /^20./)
|
42
49
|
resp_data=JSON.parse(response.body)
|
@@ -5,6 +5,7 @@ module Compute
|
|
5
5
|
attr_reader :authuser
|
6
6
|
attr_reader :authtenant
|
7
7
|
attr_reader :authkey
|
8
|
+
attr_reader :auth_method
|
8
9
|
attr_accessor :authtoken
|
9
10
|
attr_accessor :authok
|
10
11
|
attr_accessor :svrmgmthost
|
@@ -42,6 +43,7 @@ module Compute
|
|
42
43
|
@authkey = options[:api_key] || (raise Exception::MissingArgument, "Must supply an :api_key")
|
43
44
|
@auth_url = options[:auth_url] || (raise Exception::MissingArgument, "Must supply an :auth_url")
|
44
45
|
@authtenant = options[:authtenant] || @authuser
|
46
|
+
@auth_method = options[:auth_method] || "password"
|
45
47
|
@service_name = options[:service_name] || nil
|
46
48
|
@service_type = options[:service_type] || "compute"
|
47
49
|
@region = options[:region] || @region = nil
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openstack-compute
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 8
|
10
|
+
version: 1.1.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dan Prince
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-03-16 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: json
|