fog-openstack 0.1.27 → 0.1.28

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: d8ababc6eb5751d0de1a39cdb67d8b2ddf1bea19
4
- data.tar.gz: e610365bca3f0560657855964ed2256f0ae9a335
2
+ SHA256:
3
+ metadata.gz: 5ffb4956f61d6b5875ab17a4dd48dcea486aceb252a7e9590782475ba772ffb9
4
+ data.tar.gz: eade90ab213be5fddbe842351ec4b487f4767709337a0d84e09e2b65e844c4e3
5
5
  SHA512:
6
- metadata.gz: 5a3af31657b4182f41ccb5b669eb64cf412ade2a99c9ea5f6ffe7ef1c6d655013e45f5b951411e78f77dc830367ce5d7e2427698d743b1f172484ee668cfe5af
7
- data.tar.gz: 5ba34342b870c574670520189b7f8ac7be919601f61ece0dbd8ee1eb2753a3de785141d2f4548e8d954f68eed67497b9bc3a4bea69802b00536ac45ee0510ae7
6
+ metadata.gz: ad9a82a48ba92cdb59da5eeca02adbd63945e5d059cbb6e2524b285371618e5ece6f67231aac102b6d37aa993a00d649c53390e807ce28102b5b10db47470ab1
7
+ data.tar.gz: e18c7fcfd47da903b2d45e317e342fef7ac010a9cd6eebc1f2871bc5fc4eef1b30abb423fc13f330f3db578ebd30c23587bb0217756c24b49e6d22750c244400
@@ -10,16 +10,6 @@ module Fog
10
10
  # swap = Swap space in MB
11
11
  # rxtx_factor = RX/TX factor
12
12
  def create_flavor(attributes)
13
- # Get last flavor id
14
- flavor_ids = []
15
- flavors = list_flavors_detail.body['flavors'] + list_flavors_detail(:is_public => false).body['flavors']
16
- flavors.each do |flavor|
17
- flavor_ids << flavor['id'].to_i
18
- end
19
-
20
- # Set flavor id
21
- attributes[:flavor_id] = attributes[:flavor_id] || (!flavor_ids.empty? ? flavor_ids.sort.last + 1 : 1)
22
-
23
13
  data = {
24
14
  'flavor' => {
25
15
  'name' => attributes[:name],
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module OpenStack
3
- VERSION = '0.1.27'.freeze
3
+ VERSION = '0.1.28'.freeze
4
4
  end
5
5
  end
@@ -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.1.27
4
+ version: 0.1.28
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-07-10 00:00:00.000000000 Z
11
+ date: 2018-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core
@@ -1374,7 +1374,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1374
1374
  version: '0'
1375
1375
  requirements: []
1376
1376
  rubyforge_project:
1377
- rubygems_version: 2.6.14.1
1377
+ rubygems_version: 2.7.6
1378
1378
  signing_key:
1379
1379
  specification_version: 4
1380
1380
  summary: OpenStack fog provider gem