fog-openstack 1.0.3 → 1.0.4

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
- SHA1:
3
- metadata.gz: 312e6d4047265d21afbec1d567737d1df00bdba0
4
- data.tar.gz: ecc4a345b353514f3b90e06517306470d687862b
2
+ SHA256:
3
+ metadata.gz: ffc2802770e40d637228d8256fcc4920f2be1d9082c4afcf8a2496df977c2da6
4
+ data.tar.gz: 46ecf9ab40374c917f2f91de332b009fc115ee2a894ff7655c68f35f3b19ac02
5
5
  SHA512:
6
- metadata.gz: 2c79549368ed986a4a82076a8a47c28132673e4e1a40ca5a650bc5c2f440f48058822442f7b4178f18e78d60b1caf123bfb4d90d90f61915901782866ebcd8dd
7
- data.tar.gz: 5e76051a410e35fc90a7cd2f8c43df468b9c5ad08c7d2e03d197607a2e8de1662f3bc08760ca43c4d93fbf225d8bda3b298e03fc32678680815ec028f0bb5efd
6
+ metadata.gz: b7ddae4e8cec62c0b40689c777e906289f71431b72a802b3e9976d2487bcf55ab76709b2dbbd232626680ae7ed3c30a8dffecf06c22bf4d4bdff762330f0860f
7
+ data.tar.gz: d4fb6894587e32a9bceaa17056bcd865b84da9dcc49d325e610c857277801f56cc7fee8221908021fdd128317555ecdf6ff34c9f4bd8d24dc1ef04d24b3d8b94
@@ -208,7 +208,7 @@ module Fog
208
208
 
209
209
  token = Fog::OpenStack::Auth::Token.build(openstack_options, @connection_options)
210
210
 
211
- @openstack_management_url = if token.catalog
211
+ @openstack_management_url = if token.catalog && !token.catalog.payload.empty?
212
212
  token.catalog.get_endpoint_url(
213
213
  @openstack_service_type,
214
214
  @openstack_endpoint_type,
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module OpenStack
3
- VERSION = '1.0.3'.freeze
3
+ VERSION = '1.0.4'.freeze
4
4
  end
5
5
  end
@@ -1,17 +1,6 @@
1
1
  module Fog
2
2
  module OpenStack
3
3
  class Volume
4
- module Real
5
- def update_volume(volume_id, data = {})
6
- request(
7
- :body => Fog::JSON.encode('volume' => data),
8
- :expects => 200,
9
- :method => 'PUT',
10
- :path => "volumes/#{volume_id}"
11
- )
12
- end
13
- end
14
-
15
4
  module Mock
16
5
  def update_volume(volume_id, data = {})
17
6
  response = Excon::Response.new
@@ -17,7 +17,8 @@ module Fog
17
17
  data = if id.nil?
18
18
  service.create_volume(display_name, display_description, size, attributes)
19
19
  else
20
- service.update_volume(id, attributes.reject { |k, _v| k == :id })
20
+ attrib = attributes.select { |key| %i(display_name display_description metadata).include?(key) }
21
+ service.update_volume(id, attrib)
21
22
  end
22
23
  merge_attributes(data.body['volume'])
23
24
  true
@@ -1,2 +1,19 @@
1
1
  require 'fog/openstack/volume/requests/update_volume'
2
2
  require 'fog/openstack/volume/v1/requests/real'
3
+
4
+ module Fog
5
+ module OpenStack
6
+ class Volume
7
+ module Real
8
+ def update_volume(volume_id, data = {})
9
+ request(
10
+ :body => Fog::JSON.encode('volume' => data),
11
+ :expects => 200,
12
+ :method => 'PUT',
13
+ :path => "volumes/#{volume_id}"
14
+ )
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -17,7 +17,7 @@ module Fog
17
17
  data = if id.nil?
18
18
  service.create_volume(name, description, size, attributes)
19
19
  else
20
- service.update_volume(id, attributes.reject { |k, _v| k == :id })
20
+ service.update_volume(id, attributes.select { |key| %i(name description metadata).include?(key) })
21
21
  end
22
22
  merge_attributes(data.body['volume'])
23
23
  true
@@ -1,2 +1,20 @@
1
1
  require 'fog/openstack/volume/requests/update_volume'
2
2
  require 'fog/openstack/volume/v2/requests/real'
3
+
4
+ module Fog
5
+ module OpenStack
6
+ class Volume
7
+ module Real
8
+ def update_volume(volume_id, data = {})
9
+ data = data.select { |key| key == :name || key == :description || key == :metadata }
10
+ request(
11
+ :body => Fog::JSON.encode('volume' => data),
12
+ :expects => 200,
13
+ :method => 'PUT',
14
+ :path => "volumes/#{volume_id}"
15
+ )
16
+ end
17
+ end
18
+ end
19
+ end
20
+ 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.3
4
+ version: 1.0.4
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-10-02 00:00:00.000000000 Z
11
+ date: 2018-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core
@@ -1399,7 +1399,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1399
1399
  version: '0'
1400
1400
  requirements: []
1401
1401
  rubyforge_project:
1402
- rubygems_version: 2.6.14.1
1402
+ rubygems_version: 2.7.6
1403
1403
  signing_key:
1404
1404
  specification_version: 4
1405
1405
  summary: OpenStack fog provider gem