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 +5 -5
- data/lib/fog/compute/openstack/requests/create_flavor.rb +0 -10
- data/lib/fog/openstack/version.rb +1 -1
- data/lib/fog/volume/openstack/requests/update_volume.rb +1 -12
- data/lib/fog/volume/openstack/v1/models/volume.rb +2 -1
- data/lib/fog/volume/openstack/v1/requests/update_volume.rb +17 -0
- data/lib/fog/volume/openstack/v2/models/volume.rb +1 -1
- data/lib/fog/volume/openstack/v2/requests/update_volume.rb +18 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5ffb4956f61d6b5875ab17a4dd48dcea486aceb252a7e9590782475ba772ffb9
|
4
|
+
data.tar.gz: eade90ab213be5fddbe842351ec4b487f4767709337a0d84e09e2b65e844c4e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,18 +1,7 @@
|
|
1
1
|
module Fog
|
2
2
|
module Volume
|
3
3
|
class OpenStack
|
4
|
-
|
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
|
-
|
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.
|
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.
|
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-
|
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
|
1377
|
+
rubygems_version: 2.7.6
|
1378
1378
|
signing_key:
|
1379
1379
|
specification_version: 4
|
1380
1380
|
summary: OpenStack fog provider gem
|