fog-openstack 0.1.24 → 0.1.25
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/server.rb +8 -4
- data/lib/fog/compute/openstack/requests/create_key_pair.rb +1 -1
- data/lib/fog/compute/openstack/requests/delete_key_pair.rb +1 -1
- data/lib/fog/openstack/version.rb +1 -1
- data/lib/fog/storage/openstack.rb +9 -1
- data/lib/fog/storage/openstack/models/file.rb +1 -1
- data/lib/fog/storage/openstack/requests/public_url.rb +9 -1
- data/lib/fog/storage/openstack/requests/put_object.rb +24 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7747fff8d19d57ebe37075c44556ec030fed69b
|
4
|
+
data.tar.gz: a5f2d60b3888fa2053a26ed6d9e16707ef20136e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 853b8e7811143a70ba0fdf6806c8ef9c1646b1f83b391196ce2373189f3a054a55c44ba4e7d2cafa96a4115fcbafce50aa860b441e7770d782973151087eff4f
|
7
|
+
data.tar.gz: 488bd961ef8ef1df45f744dc96451dba5b63af7800e45e9faeb2be9a68c64604b9216bc2f48646a0ff8ff44d815d2ba06104dee8776871d50e7c12ea05264bbe
|
@@ -227,12 +227,16 @@ module Fog
|
|
227
227
|
end
|
228
228
|
|
229
229
|
def security_groups
|
230
|
-
|
230
|
+
if id
|
231
|
+
requires :id
|
231
232
|
|
232
|
-
|
233
|
+
groups = service.list_security_groups(:server_id => id).body['security_groups']
|
233
234
|
|
234
|
-
|
235
|
-
|
235
|
+
groups.map do |group|
|
236
|
+
Fog::Compute::OpenStack::SecurityGroup.new group.merge(:service => service)
|
237
|
+
end
|
238
|
+
else
|
239
|
+
service.security_groups.all
|
236
240
|
end
|
237
241
|
end
|
238
242
|
|
@@ -74,7 +74,15 @@ module Fog
|
|
74
74
|
require_mime_types
|
75
75
|
@openstack_api_key = options[:openstack_api_key]
|
76
76
|
@openstack_username = options[:openstack_username]
|
77
|
-
@
|
77
|
+
@openstack_management_url = options[:openstack_management_url] || 'http://example:8774/v2/AUTH_1234'
|
78
|
+
|
79
|
+
@openstack_management_uri = URI.parse(@openstack_management_url)
|
80
|
+
|
81
|
+
@host = @openstack_management_uri.host
|
82
|
+
@path = @openstack_management_uri.path
|
83
|
+
@path.sub!(%r{/$}, '')
|
84
|
+
@port = @openstack_management_uri.port
|
85
|
+
@scheme = @openstack_management_uri.scheme
|
78
86
|
end
|
79
87
|
|
80
88
|
def data
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Fog
|
2
2
|
module Storage
|
3
3
|
class OpenStack
|
4
|
-
|
4
|
+
module PublicUrl
|
5
5
|
# Get public_url for an object
|
6
6
|
#
|
7
7
|
# ==== Parameters
|
@@ -21,6 +21,14 @@ module Fog
|
|
21
21
|
"#{@scheme}://#{@host}:#{@port}#{@path}"
|
22
22
|
end
|
23
23
|
end
|
24
|
+
|
25
|
+
class Real
|
26
|
+
include PublicUrl
|
27
|
+
end
|
28
|
+
|
29
|
+
class Mock
|
30
|
+
include PublicUrl
|
31
|
+
end
|
24
32
|
end
|
25
33
|
end
|
26
34
|
end
|
@@ -36,6 +36,30 @@ module Fog
|
|
36
36
|
request(params)
|
37
37
|
end
|
38
38
|
end
|
39
|
+
|
40
|
+
class Mock
|
41
|
+
require 'digest'
|
42
|
+
|
43
|
+
def put_object(container, object, data, options = {}, &block)
|
44
|
+
dgst = Digest::MD5.new
|
45
|
+
if block_given?
|
46
|
+
Kernel.loop do
|
47
|
+
chunk = yield
|
48
|
+
break if chunk.empty?
|
49
|
+
dgst.update chunk
|
50
|
+
end
|
51
|
+
elsif data.kind_of?(String)
|
52
|
+
dgst.update data
|
53
|
+
else
|
54
|
+
dgst.file data
|
55
|
+
end
|
56
|
+
response = Excon::Response.new
|
57
|
+
response.status = 201
|
58
|
+
response.body = ''
|
59
|
+
response.headers = {'ETag' => dgst.hexdigest}
|
60
|
+
response
|
61
|
+
end
|
62
|
+
end
|
39
63
|
end
|
40
64
|
end
|
41
65
|
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.25
|
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-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|
@@ -1361,7 +1361,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1361
1361
|
version: '0'
|
1362
1362
|
requirements: []
|
1363
1363
|
rubyforge_project:
|
1364
|
-
rubygems_version: 2.6.
|
1364
|
+
rubygems_version: 2.6.14.1
|
1365
1365
|
signing_key:
|
1366
1366
|
specification_version: 4
|
1367
1367
|
summary: OpenStack fog provider gem
|