condo 2.0.2 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ee92183ae24774b0f9c5fda025f9632bb3560e7
4
- data.tar.gz: f589c67b56e83ff7252f06bad73ec7067e6ecf3e
3
+ metadata.gz: 210fbade1f7f9fabb2b484117634f51fa5771615
4
+ data.tar.gz: 73dda5a151c0eae1a37ba01c781bfc0cac187e27
5
5
  SHA512:
6
- metadata.gz: 9fe6c8701d1cb6ddcfc2e6ecd48c9f0dd9a7290fb651af2bac719f264cd91f55ed94496329d12920df90c5583dba7b5fafa28f9818d1e6229273b9f9520b54b0
7
- data.tar.gz: c8eb497535c733525785e9d1b2705af97bfcc1646a205f154a63a6636c3f65acd578d54c3b9241e954332f173a4b32df64fe1edb294d4437df359fbcad108f9f
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, # dallas or chicago - this is set at bucket creation time
16
+ :location => :dfw,
17
17
  :fog => {
18
- :provider => 'Rackspace',
19
- :rackspace_username => options[:username],
20
- :rackspace_api_key => options[:secret_key],
21
- :rackspace_cdn_url => options[:rackspace_cdn_url],
22
- :rackspace_temp_url_key => options[:temp_url_key],
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][:rackspace_region] = :dfw
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][:rackspace_region] = :ord
34
- else @options[:location]
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
- directory.files.all({'prefix' => upload.object_key}).each do |file|
207
- return false unless file.destroy
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 => "#{options[:http_only] ? 'http' : 'https'}://#{@options[:location]}#{url}?#{param}temp_url_sig=#{signature}&temp_url_expires=#{options[:object_options][:expires]}",
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
@@ -1,3 +1,3 @@
1
1
  module Condo
2
- VERSION = "2.0.2"
2
+ VERSION = "2.1.0"
3
3
  end
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.2
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-06 00:00:00.000000000 Z
11
+ date: 2016-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails