condo 2.0.2 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/condo/strata/open_stack_swift.rb +33 -18
- data/lib/condo/version.rb +1 -1
- 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: 210fbade1f7f9fabb2b484117634f51fa5771615
|
4
|
+
data.tar.gz: 73dda5a151c0eae1a37ba01c781bfc0cac187e27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02c7ba13bf57927c48b83fec81585f47c6e20980fc00a9ba72a4271ddebc54085cb0ab7464fd373ae70c9578d2092f88e5c1d18a8350273fb9f9cf11e7dd6454
|
7
|
+
data.tar.gz: f4fa3bb10f423e8ba5b9a66c1a97568401be249a51167474e8cd959cdaa91629ed3e8f23428bf2add82623ecc4bb04919690e4742ad35e20fcba3205b60ed02c
|
@@ -13,31 +13,40 @@ class Condo::Strata::OpenStackSwift
|
|
13
13
|
def initialize(options)
|
14
14
|
@options = {
|
15
15
|
:name => :OpenStackSwift,
|
16
|
-
:location => :dfw,
|
16
|
+
:location => :dfw,
|
17
17
|
:fog => {
|
18
|
-
:provider => '
|
19
|
-
:
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
23
|
-
:rackspace_auth_url => options[:auth_url] || 'https://identity.api.rackspacecloud.com/v2.0' # is US and UK is 'lon.auth.api.rackspacecloud.com'
|
18
|
+
:provider => 'OpenStack',
|
19
|
+
:openstack_username => options[:username],
|
20
|
+
:openstack_api_key => options[:secret_key],
|
21
|
+
:openstack_temp_url_key => options[:temp_url_key],
|
22
|
+
:openstack_auth_url => options[:auth_url] || 'https://identity.api.rackspacecloud.com/v2.0/tokens' # is US and UK is 'lon.auth.api.rackspacecloud.com'
|
24
23
|
}
|
25
24
|
}.merge!(options)
|
26
25
|
|
27
26
|
case @options[:location]
|
28
27
|
when :dfw, :dallas, :DFW
|
29
|
-
@options[:location] = 'storage101.dfw1.clouddrive.com'
|
30
|
-
@options[:fog][:
|
28
|
+
@options[:location] = 'https://storage101.dfw1.clouddrive.com'
|
29
|
+
@options[:fog][:openstack_region] = 'DFW'
|
31
30
|
when :ord, :chicago, :ORD
|
32
|
-
@options[:location] = 'storage101.ord1.clouddrive.com'
|
33
|
-
@options[:fog][:
|
34
|
-
|
31
|
+
@options[:location] = 'https://storage101.ord1.clouddrive.com'
|
32
|
+
@options[:fog][:openstack_region] = 'ORD'
|
33
|
+
when :iad, :virginia, :IAD
|
34
|
+
@options[:location] = 'https://storage101.iad1.clouddrive.com'
|
35
|
+
@options[:fog][:openstack_region] = 'IAD'
|
36
|
+
when :lon, :london, :LON
|
37
|
+
@options[:location] = 'https://storage101.lon1.clouddrive.com'
|
38
|
+
@options[:fog][:openstack_region] = 'LON'
|
39
|
+
when :syd, :sydney, :SYD
|
40
|
+
@options[:location] = 'https://storage101.syd1.clouddrive.com'
|
41
|
+
@options[:fog][:openstack_region] = 'SYD'
|
42
|
+
when :hkg, :hong_kong, :HKG
|
43
|
+
@options[:location] = 'https://storage101.hkg1.clouddrive.com'
|
44
|
+
@options[:fog][:openstack_region] = 'HKG'
|
45
|
+
else
|
46
|
+
@options[:fog][:openstack_management_url] = "#{@options[:location]}/v1/#{@options[:storage_url]}"
|
35
47
|
end
|
36
48
|
|
37
49
|
|
38
|
-
#raise ArgumentError, 'Rackspace Username missing' if @options[:username].nil?
|
39
|
-
#raise ArgumentError, 'Rackspace Secret Key missing' if @options[:secret_key].nil?
|
40
|
-
|
41
50
|
raise ArgumentError, 'Swift Storage URL missing' if @options[:storage_url].nil?
|
42
51
|
raise ArgumentError, 'Swift Temp URL Key missing' if @options[:temp_url_key].nil?
|
43
52
|
|
@@ -203,8 +212,14 @@ class Condo::Strata::OpenStackSwift
|
|
203
212
|
directory = connection.directories.get(upload.bucket_name) # it is assumed this exists - if not then the upload wouldn't have taken place
|
204
213
|
|
205
214
|
if upload.resumable
|
206
|
-
|
207
|
-
|
215
|
+
begin
|
216
|
+
directory.files.all({'prefix' => upload.object_key}).each do |file|
|
217
|
+
begin
|
218
|
+
return false unless file.destroy
|
219
|
+
rescue ::Fog::Storage::OpenStack::NotFound => e
|
220
|
+
end
|
221
|
+
end
|
222
|
+
rescue ::Fog::Storage::OpenStack::NotFound => e
|
208
223
|
end
|
209
224
|
end
|
210
225
|
|
@@ -234,7 +249,7 @@ class Condo::Strata::OpenStackSwift
|
|
234
249
|
# Finish building the request
|
235
250
|
return {
|
236
251
|
:verb => options[:object_options][:verb].to_s.upcase,
|
237
|
-
:url => "#{
|
252
|
+
:url => "#{@options[:location]}#{url}?#{param}temp_url_sig=#{signature}&temp_url_expires=#{options[:object_options][:expires]}",
|
238
253
|
:headers => options[:object_options][:headers]
|
239
254
|
}
|
240
255
|
end
|
data/lib/condo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: condo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen von Takach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|