fog-openstack 0.1.18 → 0.1.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fog/compute/openstack/models/image.rb +1 -0
- data/lib/fog/compute/openstack/requests/update_quota.rb +0 -1
- data/lib/fog/image/openstack/v1/models/images.rb +23 -1
- data/lib/fog/image/openstack/v1/requests/get_image_by_id.rb +20 -12
- data/lib/fog/image/openstack/v2/models/images.rb +2 -0
- data/lib/fog/network/openstack/requests/create_floating_ip.rb +1 -1
- data/lib/fog/openstack/version.rb +1 -1
- data/lib/fog/volume/openstack/requests/update_quota.rb +0 -1
- data/lib/fog/volume/openstack/v1/models/snapshot.rb +1 -0
- data/lib/fog/volume/openstack/v2/models/snapshot.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc6df6714fdc0919e30d872748400f21dd6a1b76
|
4
|
+
data.tar.gz: 3d057c3aad27a48d1ee8901f71b4b85fe7e03de2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36bfe27a022057590ce817e20089d3bfe7ff00e42be16173d9077cb3b1dd314047486d359ad5f65dd0d3d489804315506031d014ba8b2cfe02f88f195d10ead1
|
7
|
+
data.tar.gz: bc82e6dee769885e863f2f0e9dd822d4210e1fb2628fa8daec888c08f29dca37c6c1be55e7b626b601a0f8e7e24df6b0ef6c9a4f897668d84f1158afdd18379d
|
@@ -23,7 +23,12 @@ module Fog
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def find_by_id(id)
|
26
|
-
|
26
|
+
marker = 'X-Image-Meta-'
|
27
|
+
params = service.get_image_by_id(id).headers.select{|h,_| h.include?(marker) }
|
28
|
+
params = params.map{|k,v| [k.gsub(marker,'').downcase, convert_to_type(v)]}
|
29
|
+
new(Hash[params])
|
30
|
+
rescue Fog::Image::OpenStack::NotFound
|
31
|
+
nil
|
27
32
|
end
|
28
33
|
alias get find_by_id
|
29
34
|
|
@@ -62,6 +67,23 @@ module Fog
|
|
62
67
|
attribute = attribute.to_s.gsub("find_by_", "")
|
63
68
|
load(service.list_public_images_detailed(attribute, value).body['images'])
|
64
69
|
end
|
70
|
+
|
71
|
+
private
|
72
|
+
|
73
|
+
def convert_to_type(v)
|
74
|
+
case v
|
75
|
+
when /^\d+$/
|
76
|
+
v.to_i
|
77
|
+
when 'True'
|
78
|
+
true
|
79
|
+
when 'False'
|
80
|
+
false
|
81
|
+
when /^\d\d\d\d\-\d\d\-\d\dT/
|
82
|
+
::Time.parse(v)
|
83
|
+
else
|
84
|
+
v
|
85
|
+
end
|
86
|
+
end
|
65
87
|
end
|
66
88
|
end
|
67
89
|
end
|
@@ -5,27 +5,35 @@ module Fog
|
|
5
5
|
class Real
|
6
6
|
def get_image_by_id(image_id)
|
7
7
|
request(
|
8
|
-
:expects => [200
|
9
|
-
:method => '
|
8
|
+
:expects => [200],
|
9
|
+
:method => 'HEAD',
|
10
10
|
:path => "images/#{image_id}"
|
11
11
|
)
|
12
12
|
end
|
13
13
|
end # class Real
|
14
14
|
|
15
15
|
class Mock
|
16
|
-
def get_image_by_id(
|
16
|
+
def get_image_by_id(image_id)
|
17
17
|
response = Excon::Response.new
|
18
18
|
response.status = [200, 204][rand(2)]
|
19
|
-
response.
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
19
|
+
response.headers = {
|
20
|
+
'X-Image-Meta-Checksum' => '8a40c862b5735975d82605c1dd395796',
|
21
|
+
'X-Image-Meta-Container_format' => 'aki',
|
22
|
+
'X-Image-Meta-Created_at' => '2016-01-06T03:22:20.000000',
|
23
|
+
'X-Image-Meta-Deleted' => 'False',
|
24
|
+
'X-Image-Meta-Disk_format' => 'aki',
|
25
|
+
'X-Image-Meta-Id' => image_id,
|
26
|
+
'X-Image-Meta-Is_public' => 'True',
|
27
|
+
'X-Image-Meta-Min_disk' => 0,
|
28
|
+
'X-Image-Meta-Min_ram' => 0,
|
29
|
+
'X-Image-Meta-Name' => 'cirros-0.3.4-x86_64-uec-kernel',
|
30
|
+
'X-Image-Meta-Owner' => '13cc6052265b41529e2fd0fc461fa8ef',
|
31
|
+
'X-Image-Meta-Protected' => 'False',
|
32
|
+
'X-Image-Meta-Size' => 4979632,
|
33
|
+
'X-Image-Meta-Status' => 'deactivated',
|
34
|
+
'X-Image-Meta-Updated_at' => '2016-02-25T03:02:05.000000'
|
28
35
|
}
|
36
|
+
response.body = {}
|
29
37
|
response
|
30
38
|
end # def list_tenants
|
31
39
|
end # class Mock
|
@@ -9,7 +9,7 @@ module Fog
|
|
9
9
|
}
|
10
10
|
}
|
11
11
|
|
12
|
-
vanilla_options = [:port_id, :tenant_id, :fixed_ip_address, :floating_ip_address]
|
12
|
+
vanilla_options = [:port_id, :tenant_id, :fixed_ip_address, :floating_ip_address, :subnet_id]
|
13
13
|
vanilla_options.reject { |o| options[o].nil? }.each do |key|
|
14
14
|
data['floatingip'][key] = options[key]
|
15
15
|
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.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Darby
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|