fog-openstack 0.3.7 → 0.3.8

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
  SHA256:
3
- metadata.gz: 8d4f6f296042ce4fbe8bcc9a34f41230d22120eace896faf0890bed959a01795
4
- data.tar.gz: b8b6344dcd92e3c7799934a03732390046135199991cd9666ea636eae65a5829
3
+ metadata.gz: 051a0ad3e3a78f20fd942c90011fd5bce4798ccfbfe36a7b7f0e063e033d473c
4
+ data.tar.gz: 258c191d94c95a896d9d0d2a8bac64f9c8583e83e9d8913fe10a4dbf936db9e8
5
5
  SHA512:
6
- metadata.gz: d2d8f82d2cd1c4590bdfe034dffb8ea523d599c628f98cca3373a5b51b46145e8f936b644011518d14042c7801fd00f0b9c802288e43e178b92514d9a8db906d
7
- data.tar.gz: 749138df313ee2cc5f8cac6255573ddc21e6fb4d47ac7ebdaa19856cae0b3b5ee0e0981d7b704ea44b8e9baa5f6d0d147eaed910aa2ddd9b37d5ba9b9f72caf8
6
+ metadata.gz: 2c32d11143fa95c41d7502067fbc3f3acf818a836b115fbf942f80ac5107c832cf18a2f11afbe669a20973921b177e18cb39749d7984452f7f9f1db7f2c23bd5
7
+ data.tar.gz: b9a9b2a0509d98e6e6cfd1f1e6c0ab2e429a3f477f52081249c8a1ba5eeb745a84495e1784e66d86009e07aa42a12430d62f094432f23b09c6f7709247613717
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module OpenStack
3
- VERSION = '0.3.7'.freeze
3
+ VERSION = '0.3.8'.freeze
4
4
  end
5
5
  end
@@ -12,7 +12,7 @@ module Fog
12
12
  # * options<~Hash> - Additional headers
13
13
  def copy_object(source_container_name, source_object_name, target_container_name, target_object_name, options = {})
14
14
  headers = {'X-Copy-From' => "/#{source_container_name}/#{source_object_name}"}.merge(options)
15
- request(:expects => 201,
15
+ request(:expects => [201, 202],
16
16
  :headers => headers,
17
17
  :method => 'PUT',
18
18
  :path => "#{Fog::OpenStack.escape(target_container_name)}/#{Fog::OpenStack.escape(target_object_name)}")
@@ -26,7 +26,7 @@ module Fog
26
26
  end
27
27
 
28
28
  params.merge!(
29
- :expects => 201,
29
+ :expects => [201, 202],
30
30
  :idempotent => !params[:request_block],
31
31
  :headers => headers,
32
32
  :method => 'PUT',
@@ -1,18 +1,7 @@
1
1
  module Fog
2
2
  module Volume
3
3
  class OpenStack
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
- module Mock
4
+ module Mock
16
5
  def update_volume(volume_id, data = {})
17
6
  response = Excon::Response.new
18
7
  response.status = 200
@@ -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/volume/openstack/requests/update_volume'
2
2
  require 'fog/volume/openstack/v1/requests/real'
3
+
4
+ module Fog
5
+ module Volume
6
+ class OpenStack
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/volume/openstack/requests/update_volume'
2
2
  require 'fog/volume/openstack/v2/requests/real'
3
+
4
+ module Fog
5
+ module Volume
6
+ class OpenStack
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: 0.3.7
4
+ version: 0.3.8
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-19 00:00:00.000000000 Z
11
+ date: 2018-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core