fog-openstack 1.0.2 → 1.0.3

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: ea0e7a81cd4d076ed16a5cab127a5ab730881d3e
4
- data.tar.gz: 5128d367de9376015965157fbc610040b11be008
3
+ metadata.gz: 312e6d4047265d21afbec1d567737d1df00bdba0
4
+ data.tar.gz: ecc4a345b353514f3b90e06517306470d687862b
5
5
  SHA512:
6
- metadata.gz: 25784e5390b52943bfb2af9b0e99dc4f53a5fc1d443d7fa82b4677a4a8bb0c321078cb5c9e184d6033fc7e1737bd5b9c61cbf7d9ad2914d4e34b06a0636bf276
7
- data.tar.gz: 222a1f8668c1b81c5be08e5264cc956e61f9a46efecf96635efa5258ee325971fc46647a695acfc04132991b5af1813f70bd769b67b3cbed2b9436fb3a02df5b
6
+ metadata.gz: 2c79549368ed986a4a82076a8a47c28132673e4e1a40ca5a650bc5c2f440f48058822442f7b4178f18e78d60b1caf123bfb4d90d90f61915901782866ebcd8dd
7
+ data.tar.gz: 5e76051a410e35fc90a7cd2f8c43df468b9c5ad08c7d2e03d197607a2e8de1662f3bc08760ca43c4d93fbf225d8bda3b298e03fc32678680815ec028f0bb5efd
@@ -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 = '1.0.2'.freeze
3
+ VERSION = '1.0.3'.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: 1.0.2
4
+ version: 1.0.3
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