fog-openstack 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fog/identity/openstack.rb +1 -20
- data/lib/fog/identity/openstack/v2.rb +6 -6
- data/lib/fog/identity/openstack/v3.rb +6 -6
- data/lib/fog/openstack/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aecda82f58600858370cf9cfaf02cce488a57bc8
|
4
|
+
data.tar.gz: 45287b13e8061378835d5da407b491016b1aa172
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8473feca37f5c98d830f91e4942609cc4c64664798203352e7a0f400621c507ba1f18d4c5c2ada45986771690ddd114ddb637583ab37bf3d80d8228e4096cb8
|
7
|
+
data.tar.gz: 69ba5d22a7f10d0864fbff96b7c56feea3456b02fb417e6bbe7d69c7620a819d5d32d4a36cdb04e95a42184e2c4c8aa14f29929706ceded413f2aa55be5ec5f8
|
@@ -5,26 +5,7 @@ module Fog
|
|
5
5
|
autoload :V3, 'fog/identity/openstack/v3'
|
6
6
|
|
7
7
|
def self.new(args = {})
|
8
|
-
|
9
|
-
'2.0'
|
10
|
-
elsif args[:openstack_auth_url] =~ /v3|v2(\.0)*/
|
11
|
-
# Deprecated from fog-openstack 0.2.0
|
12
|
-
# Will be removed in future after hard deprecation is enforced for a couple of releases
|
13
|
-
Fog::Logger.deprecation("An authentication URL including a version is deprecated")
|
14
|
-
case args[:openstack_auth_url]
|
15
|
-
when /\/v3(\/)*.*$/
|
16
|
-
args[:openstack_auth_url].gsub!(/\/v3(\/)*.*$/, '')
|
17
|
-
args[:no_path_prefix] = true
|
18
|
-
'3'
|
19
|
-
when /\/v2(\.0)*(\/)*.*$/
|
20
|
-
args[:openstack_auth_url].gsub!(/\/v2(\.0)*(\/)*.*$/, '')
|
21
|
-
args[:no_path_prefix] = true
|
22
|
-
'2.0'
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
case version
|
27
|
-
when '2.0'
|
8
|
+
if args[:openstack_identity_api_version] =~ /(v)*2(\.0)*/i
|
28
9
|
Fog::Identity::OpenStack::V2.new(args)
|
29
10
|
else
|
30
11
|
Fog::Identity::OpenStack::V3.new(args)
|
@@ -169,12 +169,8 @@ module Fog
|
|
169
169
|
end
|
170
170
|
|
171
171
|
class Real < Fog::Identity::OpenStack::Real
|
172
|
-
def
|
173
|
-
@path_prefix =
|
174
|
-
''
|
175
|
-
else
|
176
|
-
'v2.0'
|
177
|
-
end
|
172
|
+
def api_path_prefix
|
173
|
+
@path_prefix = version_in_path?(@openstack_management_uri.path) ? '' : 'v2.0'
|
178
174
|
super
|
179
175
|
end
|
180
176
|
|
@@ -185,6 +181,10 @@ module Fog
|
|
185
181
|
def default_service_type
|
186
182
|
%w[identity_v2 identityv2 identity]
|
187
183
|
end
|
184
|
+
|
185
|
+
def version_in_path?(url)
|
186
|
+
true if url =~ /\/v2(\.0)*(\/)*.*$/
|
187
|
+
end
|
188
188
|
end
|
189
189
|
end
|
190
190
|
end
|
@@ -142,12 +142,8 @@ module Fog
|
|
142
142
|
end
|
143
143
|
|
144
144
|
class Real < Fog::Identity::OpenStack::Real
|
145
|
-
def
|
146
|
-
@path_prefix =
|
147
|
-
''
|
148
|
-
else
|
149
|
-
'v3'
|
150
|
-
end
|
145
|
+
def api_path_prefix
|
146
|
+
@path_prefix = version_in_path?(@openstack_management_uri.path) ? '' : 'v3'
|
151
147
|
super
|
152
148
|
end
|
153
149
|
|
@@ -158,6 +154,10 @@ module Fog
|
|
158
154
|
def default_service_type
|
159
155
|
%w[identity_v3 identityv3 identity]
|
160
156
|
end
|
157
|
+
|
158
|
+
def version_in_path?(url)
|
159
|
+
true if url =~ /\/v3(\/)*.*$/
|
160
|
+
end
|
161
161
|
end
|
162
162
|
end
|
163
163
|
end
|