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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e709d55ce5fa6e2513278e19a6f949053ac3d9ab
4
- data.tar.gz: '0948ccd18c50d50da4fb742dbf4837cd70afb351'
3
+ metadata.gz: aecda82f58600858370cf9cfaf02cce488a57bc8
4
+ data.tar.gz: 45287b13e8061378835d5da407b491016b1aa172
5
5
  SHA512:
6
- metadata.gz: c84b8d3f4a0f8ca80601595a606148e28c38729c4180b9969c23b17514699596a278dab94b5ce321586ef9a0af5cf1de963aa070fd0c2a6f27e8cfe51e5f7a98
7
- data.tar.gz: cf712ed9aae98300e32b68a0c99a264d3c1dc79fb8975ef8da1c85e5228e4b629c0a14136fe08287654a7ed68c2d839131a48348ef0570bcdd3d36f0e9b69d37
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
- version = if args[:openstack_identity_api_version] =~ /(v)*2(\.0)*/i
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 initialize(args)
173
- @path_prefix = if args[:no_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 initialize(args)
146
- @path_prefix = if args[:no_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
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module OpenStack
3
- VERSION = '0.3.4'.freeze
3
+ VERSION = '0.3.5'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-openstack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Darby