fog-openstack 0.2.1 → 0.2.2

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: 9b30f652b4b6df666a43ce5d8a5df9e999062ea3
4
- data.tar.gz: b0ef11fb9333c0987ae31ecead2c2f99ddf107a6
3
+ metadata.gz: dd7c2060dd814a7a8348163937e8a1912789a29e
4
+ data.tar.gz: f5cd9bd84435b5502f0cc416c2aa98c24f4137fe
5
5
  SHA512:
6
- metadata.gz: b96108935e442c7667530a689be9911a55a1c5d137b0072e322af3c47140e9fb1cdbae3f679838bda873169f719e84521bd08cef8b94ca9bf23d078f18e36e7d
7
- data.tar.gz: 3b95ad280e133a331c803e7fd9b5daf3632085fa1ee0c05304cf9202e957a38a223c5eabe2752c4a81354483877ba6ff8aea8c45b81b885205b41e17e0f285f2
6
+ metadata.gz: 04d8c75eaa4931ad90290faadab052593a9ad9948876499b440273d278c4cc2e5a7f0aa6e5ecad30cb4eeed6d8dae7cff3453b4c6570bea8696b01781c00d867
7
+ data.tar.gz: 30b7cd277e256ee6a29077ffb74dc107216c84e4f102c7b92dba3ded1e2d33f7499002c0b3e522bf368628e31e14f7881a1a978e17a49aaf715bbaea3c2a8367
data/README.md CHANGED
@@ -42,12 +42,12 @@ Checklist:
42
42
  * All following examples assume that `@connection_params` is a hash of valid connection information for an OpenStack cloud.
43
43
  * The `:openstack_username` and `:openstack_api_key` keys must map to a valid user/password combination in Keystone.
44
44
  * If you don't know what domain your user belongs to, chances are it's the `default` domain. By default, all users are a member of the `default` domain unless otherwise specified.
45
-
45
+ * Keystone endpoints are version less. Version 3 is the default as v2.0 is deprecated. Meanwhile Keystone V3 still supports v2.0 for backward compatibility. Therefore passing a tenant instead of a project (along with a domain) makes Keystone provide v2.0 token.
46
46
  Connection parameters:
47
47
 
48
48
  ```ruby
49
49
  @connection_params = {
50
- openstack_auth_url: "http://devstack.test:5000/v3/auth/tokens",
50
+ openstack_auth_url: "http://devstack.test:5000",
51
51
  openstack_username: "admin",
52
52
  openstack_api_key: "password",
53
53
  openstack_project_name: "admin",
@@ -55,14 +55,15 @@ Connection parameters:
55
55
  }
56
56
  ```
57
57
 
58
- If you're using Keystone V2, you don't need to supply domain details but ensure the `openstack_auth_url` parameter references the correct endpoint.
58
+ If you're using Keystone V2, you don't need to supply domain details but ensure to either provide a tenant name (`openstack_tenant`)
59
+ or a tenant id (`openstack_tenant_id`). Alternatively you can use `:openstack_identity_api_version` parameter with 'v2.0'.
59
60
 
60
61
  ```ruby
61
62
  @connection_params = {
62
- openstack_auth_url: "http://devstack.test:5000/v2.0/tokens",
63
- openstack_username: "admin",
64
- openstack_api_key: "password",
65
- openstack_project_name: "admin"
63
+ openstack_auth_url: "http://devstack.test:5000",
64
+ openstack_username: "admin",
65
+ openstack_api_key: "password",
66
+ openstack_tenant: "admin"
66
67
  }
67
68
  ```
68
69
 
@@ -3,13 +3,15 @@
3
3
  require 'fog/openstack'
4
4
  require 'pp'
5
5
 
6
- auth_url = "https://example.net/v2.0/tokens"
6
+ auth_url = "https://example.net"
7
7
  username = 'admin@example.net'
8
8
  password = 'secret'
9
+ tenant = 'admin'
9
10
 
10
11
  keystone = Fog::Identity::OpenStack.new :openstack_auth_url => auth_url,
11
12
  :openstack_username => username,
12
- :openstack_api_key => password
13
+ :openstack_api_key => password,
14
+ :openstack_tenant => tenant
13
15
  # Optional, self-signed certs
14
16
  #:connection_options => { :ssl_verify_peer => false }
15
17
 
@@ -3,14 +3,12 @@
3
3
  require 'fog/openstack'
4
4
  require 'pp'
5
5
 
6
- auth_url = "https://example.net:35357/v3/auth/tokens"
6
+ auth_url = "https://example.net:35357"
7
7
  username = 'admin@example.net'
8
8
  password = 'secret'
9
9
  project = 'admin'
10
10
  domain = 'Default'
11
11
 
12
-
13
-
14
12
  keystone = Fog::Identity::OpenStack.new :openstack_auth_url => auth_url,
15
13
  :openstack_username => username,
16
14
  :openstack_api_key => password,
@@ -190,7 +190,7 @@ module Fog
190
190
 
191
191
  def patch_attributes_to_add(client_attributes, server_attributes)
192
192
  client_attributes.reject do |key, _|
193
- server_attributes.key?(key)
193
+ server_attributes.key?(key) || client_attributes[key].nil?
194
194
  end
195
195
  end
196
196
 
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module OpenStack
3
- VERSION = '0.2.1'.freeze
3
+ VERSION = '0.2.2'.freeze
4
4
  end
5
5
  end
@@ -77,12 +77,8 @@ module Fog
77
77
  @openstack_management_url = options[:openstack_management_url] || 'http://example:8774/v2/AUTH_1234'
78
78
 
79
79
  @openstack_management_uri = URI.parse(@openstack_management_url)
80
-
81
- @host = @openstack_management_uri.host
82
80
  @path = @openstack_management_uri.path
83
81
  @path.sub!(%r{/$}, '')
84
- @port = @openstack_management_uri.port
85
- @scheme = @openstack_management_uri.scheme
86
82
  end
87
83
 
88
84
  def data
@@ -38,9 +38,9 @@ module Fog
38
38
  raise ArgumentError, "Insufficient parameters specified." unless container && object && expires && method
39
39
  raise ArgumentError, "Storage must be instantiated with the :openstack_temp_url_key option" if @openstack_temp_url_key.nil?
40
40
 
41
- scheme = options[:scheme] || @scheme
42
- host = options[:host] || @host
43
- port = options[:port] || @port
41
+ scheme = options[:scheme] || @openstack_management_uri.scheme
42
+ host = options[:host] || @openstack_management_uri.host
43
+ port = options[:port] || @openstack_management_uri.port
44
44
 
45
45
  # POST not allowed
46
46
  allowed_methods = %w(GET PUT HEAD)
@@ -18,7 +18,8 @@ module Fog
18
18
  private
19
19
 
20
20
  def url
21
- "#{@scheme}://#{@host}:#{@port}#{@path}"
21
+ "#{@openstack_management_uri.scheme}://#{@openstack_management_uri.host}:"\
22
+ "#{@openstack_management_uri.port}#{@path}"
22
23
  end
23
24
  end
24
25
 
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.2.1
4
+ version: 0.2.2
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-02 00:00:00.000000000 Z
11
+ date: 2018-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core