fog-openstack 0.3.5 → 0.3.6

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: aecda82f58600858370cf9cfaf02cce488a57bc8
4
- data.tar.gz: 45287b13e8061378835d5da407b491016b1aa172
3
+ metadata.gz: 39cd4a4f51a9a8cdc53e08bc406ccdad889ca29e
4
+ data.tar.gz: 6dfa9f87ad922e621765585fadd7c96e07d3117d
5
5
  SHA512:
6
- metadata.gz: c8473feca37f5c98d830f91e4942609cc4c64664798203352e7a0f400621c507ba1f18d4c5c2ada45986771690ddd114ddb637583ab37bf3d80d8228e4096cb8
7
- data.tar.gz: 69ba5d22a7f10d0864fbff96b7c56feea3456b02fb417e6bbe7d69c7620a819d5d32d4a36cdb04e95a42184e2c4c8aa14f29929706ceded413f2aa55be5ec5f8
6
+ metadata.gz: 83288f34c2571e579f596c794752a28e9fe05ef3afe109e1f3712d6219244caf411a1627d0449181f78dcb725358e79747da42dde52e9cbaa9f6da882808017a
7
+ data.tar.gz: 5c417eff1ac670fafb9c95ac553703784935c758e839f079a5e08bb7ef94bbb865444fff0eb0432d6fc2cd4ca596dc3509a768204bdd891339f49b6d4e56a412
@@ -47,7 +47,7 @@ module Fog
47
47
  :headers => {'Content-Type' => 'application/json'},
48
48
  :body => Fog::JSON.encode(creds[:data]),
49
49
  :method => 'POST',
50
- :path => creds[:uri].path + path
50
+ :path => creds[:uri].path + prefix_path(creds[:uri]) + path
51
51
  }
52
52
 
53
53
  connection.request(request)
@@ -29,8 +29,16 @@ module Fog
29
29
  {'auth' => identity}
30
30
  end
31
31
 
32
+ def prefix_path(uri)
33
+ if uri.path =~ /\/v2(\.0)*(\/)*.*$/
34
+ ''
35
+ else
36
+ '/v2.0'
37
+ end
38
+ end
39
+
32
40
  def path
33
- '/v2.0/tokens'
41
+ '/tokens'
34
42
  end
35
43
 
36
44
  def user_credentials
@@ -37,8 +37,16 @@ module Fog
37
37
  end
38
38
  end
39
39
 
40
+ def prefix_path(uri)
41
+ if uri.path =~ /\/v3(\/)*.*$/
42
+ ''
43
+ else
44
+ '/v3'
45
+ end
46
+ end
47
+
40
48
  def path
41
- '/v3/auth/tokens'
49
+ '/auth/tokens'
42
50
  end
43
51
 
44
52
  def scope
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module OpenStack
3
- VERSION = '0.3.5'.freeze
3
+ VERSION = '0.3.6'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-openstack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Darby
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-27 00:00:00.000000000 Z
11
+ date: 2018-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core