fog 1.33.0 → 1.34.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +47 -0
  3. data/Rakefile +3 -0
  4. data/fog.gemspec +4 -4
  5. data/lib/fog/openstack/baremetal.rb +20 -82
  6. data/lib/fog/openstack/compute.rb +11 -34
  7. data/lib/fog/openstack/core.rb +37 -10
  8. data/lib/fog/openstack/identity.rb +33 -44
  9. data/lib/fog/openstack/identity_v2.rb +14 -84
  10. data/lib/fog/openstack/identity_v3.rb +4 -51
  11. data/lib/fog/openstack/image.rb +22 -83
  12. data/lib/fog/openstack/metering.rb +15 -76
  13. data/lib/fog/openstack/models/compute/server.rb +1 -1
  14. data/lib/fog/openstack/models/orchestration/events.rb +1 -0
  15. data/lib/fog/openstack/models/orchestration/resources.rb +1 -0
  16. data/lib/fog/openstack/models/orchestration/stack.rb +1 -1
  17. data/lib/fog/openstack/models/orchestration/stacks.rb +1 -0
  18. data/lib/fog/openstack/models/orchestration/templates.rb +1 -0
  19. data/lib/fog/openstack/network.rb +21 -21
  20. data/lib/fog/openstack/orchestration.rb +11 -91
  21. data/lib/fog/openstack/planning.rb +19 -81
  22. data/lib/fog/openstack/requests/compute/list_security_groups.rb +9 -1
  23. data/lib/fog/openstack/requests/network/add_router_interface.rb +12 -4
  24. data/lib/fog/openstack/requests/network/create_port.rb +14 -12
  25. data/lib/fog/openstack/requests/network/get_port.rb +4 -0
  26. data/lib/fog/openstack/requests/network/set_tenant.rb +1 -0
  27. data/lib/fog/openstack/storage.rb +18 -57
  28. data/lib/fog/openstack/volume.rb +17 -79
  29. data/lib/fog/rackspace/requests/storage/get_object_https_url.rb +13 -2
  30. data/lib/fog/vcloud_director/generators/compute/edge_gateway_service_configuration.rb +7 -6
  31. data/lib/fog/vcloud_director/models/compute/vm_customizations.rb +15 -0
  32. data/lib/fog/version.rb +1 -1
  33. data/lib/tasks/changelog_task.rb +1 -0
  34. data/spec/fog/openstack/volume_spec.rb +5 -0
  35. data/tests/compute/helper.rb +0 -6
  36. data/tests/openstack/requests/network/port_tests.rb +14 -12
  37. data/tests/rackspace/requests/storage/object_tests.rb +46 -4
  38. data/tests/vcloud_director/requests/compute/edge_gateway_tests.rb +2 -2
  39. metadata +11 -74
  40. data/lib/fog/bin/dynect.rb +0 -28
  41. data/tests/brightbox/compute/helper.rb +0 -1
  42. data/tests/brightbox/compute/schema.rb +0 -799
  43. data/tests/brightbox/compute_tests.rb +0 -101
  44. data/tests/brightbox/helper.rb +0 -1
  45. data/tests/brightbox/models/compute/account_tests.rb +0 -17
  46. data/tests/brightbox/models/compute/cloud_ip_tests.rb +0 -32
  47. data/tests/brightbox/models/compute/database_server_tests.rb +0 -78
  48. data/tests/brightbox/models/compute/database_snapshot_tests.rb +0 -26
  49. data/tests/brightbox/models/compute/database_type_tests.rb +0 -27
  50. data/tests/brightbox/models/compute/server_tests.rb +0 -19
  51. data/tests/brightbox/oauth2_tests.rb +0 -110
  52. data/tests/brightbox/requests/compute/account_tests.rb +0 -65
  53. data/tests/brightbox/requests/compute/api_client_tests.rb +0 -64
  54. data/tests/brightbox/requests/compute/application_test.rb +0 -63
  55. data/tests/brightbox/requests/compute/cloud_ip_tests.rb +0 -85
  56. data/tests/brightbox/requests/compute/collaboration_tests.rb +0 -39
  57. data/tests/brightbox/requests/compute/database_server_tests.rb +0 -54
  58. data/tests/brightbox/requests/compute/database_snapsnot_tests.rb +0 -47
  59. data/tests/brightbox/requests/compute/database_type_tests.rb +0 -17
  60. data/tests/brightbox/requests/compute/firewall_policy_tests.rb +0 -40
  61. data/tests/brightbox/requests/compute/firewall_rule_tests.rb +0 -43
  62. data/tests/brightbox/requests/compute/helper.rb +0 -41
  63. data/tests/brightbox/requests/compute/image_tests.rb +0 -60
  64. data/tests/brightbox/requests/compute/interface_tests.rb +0 -33
  65. data/tests/brightbox/requests/compute/load_balancer_tests.rb +0 -121
  66. data/tests/brightbox/requests/compute/server_group_tests.rb +0 -96
  67. data/tests/brightbox/requests/compute/server_tests.rb +0 -99
  68. data/tests/brightbox/requests/compute/server_type_tests.rb +0 -34
  69. data/tests/brightbox/requests/compute/user_collaboration_tests.rb +0 -67
  70. data/tests/brightbox/requests/compute/user_tests.rb +0 -38
  71. data/tests/brightbox/requests/compute/zone_tests.rb +0 -34
@@ -34,6 +34,10 @@ module Fog
34
34
  'device_owner' => 'network:dhcp',
35
35
  'tenant_id' => 'f8b26a6032bc47718a7702233ac708b9',
36
36
  'security_groups' => ['3ddde803-e550-4737-b5de-0862401dc834'],
37
+ 'allowed_address_pairs' => [
38
+ 'ip_address' => '10.1.1.1',
39
+ 'mac_address' => 'fa:16:3e:3d:2a:cc'
40
+ ]
37
41
  }
38
42
  }
39
43
  response
@@ -6,6 +6,7 @@ module Fog
6
6
  @openstack_must_reauthenticate = true
7
7
  @openstack_tenant = tenant.to_s
8
8
  authenticate
9
+ set_api_path
9
10
  end
10
11
  end
11
12
 
@@ -5,11 +5,15 @@ module Fog
5
5
  class OpenStack < Fog::Service
6
6
  requires :openstack_auth_url, :openstack_username,
7
7
  :openstack_api_key
8
- recognizes :persistent, :openstack_service_name,
9
- :openstack_service_type, :openstack_tenant,
10
- :openstack_region, :openstack_temp_url_key,
11
- :openstack_endpoint_type, :openstack_auth_token,
12
- :openstack_management_url
8
+ recognizes :openstack_auth_token, :openstack_management_url,
9
+ :persistent, :openstack_service_type, :openstack_service_name,
10
+ :openstack_tenant, :openstack_tenant_id,
11
+ :openstack_api_key, :openstack_username, :openstack_identity_endpoint,
12
+ :current_user, :current_tenant, :openstack_region,
13
+ :openstack_endpoint_type,
14
+ :openstack_project_name, :openstack_project_id,
15
+ :openstack_project_domain, :openstack_user_domain, :openstack_domain_name,
16
+ :openstack_project_domain_id, :openstack_user_domain_id, :openstack_domain_id
13
17
 
14
18
  model_path 'fog/openstack/models/storage'
15
19
  model :directory
@@ -76,30 +80,21 @@ module Fog
76
80
  end
77
81
 
78
82
  class Real
83
+ include Fog::OpenStack::Core
84
+
79
85
  def initialize(options={})
80
- @openstack_api_key = options[:openstack_api_key]
81
- @openstack_username = options[:openstack_username]
82
- @openstack_auth_url = options[:openstack_auth_url]
83
- @openstack_auth_token = options[:openstack_auth_token]
84
- @openstack_storage_url = options[:openstack_storage_url]
85
- @openstack_must_reauthenticate = false
86
- @openstack_service_type = options[:openstack_service_type] || ['object-store']
87
- @openstack_service_name = options[:openstack_service_name]
88
- @openstack_region = options[:openstack_region]
89
- @openstack_tenant = options[:openstack_tenant]
90
- @connection_options = options[:connection_options] || {}
91
- @openstack_temp_url_key = options[:openstack_temp_url_key]
92
- @openstack_endpoint_type = options[:openstack_endpoint_type] || 'publicURL'
93
- @openstack_management_url = options[:openstack_management_url]
86
+ initialize_identity options
87
+
88
+ @openstack_service_type = options[:openstack_service_type] || ['object-store']
89
+ @openstack_service_name = options[:openstack_service_name]
90
+
91
+ @connection_options = options[:connection_options] || {}
92
+
94
93
  authenticate
95
94
  @persistent = options[:persistent] || false
96
95
  @connection = Fog::Core::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
97
96
  end
98
97
 
99
- def reload
100
- @connection.reset
101
- end
102
-
103
98
  # Change the current account while re-using the auth token.
104
99
  #
105
100
  # This is usefull when you have an admin role and you're able
@@ -180,40 +175,6 @@ module Fog
180
175
 
181
176
  private
182
177
 
183
- def authenticate
184
- if !@openstack_management_url || @openstack_must_reauthenticate
185
- options = {
186
- :openstack_api_key => @openstack_api_key,
187
- :openstack_username => @openstack_username,
188
- :openstack_auth_uri => URI.parse(@openstack_auth_url),
189
- :openstack_service_type => @openstack_service_type,
190
- :openstack_service_name => @openstack_service_name,
191
- :openstack_region => @openstack_region,
192
- :openstack_tenant => @openstack_tenant,
193
- :openstack_endpoint_type => @openstack_endpoint_type
194
- }
195
-
196
- credentials = Fog::OpenStack.authenticate(options, @connection_options)
197
-
198
- @current_user = credentials[:user]
199
- @current_tenant = credentials[:tenant]
200
-
201
- @openstack_must_reauthenticate = false
202
- @auth_token = credentials[:token]
203
- @openstack_management_url = credentials[:server_management_url]
204
- uri = URI.parse(@openstack_management_url)
205
- else
206
- @auth_token = @openstack_auth_token
207
- uri = URI.parse(@openstack_management_url)
208
- end
209
-
210
- @host = uri.host
211
- @path = uri.path
212
- @path.sub!(/\/$/, '')
213
- @port = uri.port
214
- @scheme = uri.scheme
215
- true
216
- end
217
178
  end
218
179
  end
219
180
  end
@@ -4,11 +4,15 @@ module Fog
4
4
  module Volume
5
5
  class OpenStack < Fog::Service
6
6
  requires :openstack_auth_url
7
- recognizes :openstack_auth_token, :openstack_management_url, :persistent,
8
- :openstack_service_type, :openstack_service_name, :openstack_tenant,
9
- :openstack_api_key, :openstack_username,
10
- :current_user, :current_tenant,
11
- :openstack_endpoint_type, :openstack_region
7
+ recognizes :openstack_auth_token, :openstack_management_url,
8
+ :persistent, :openstack_service_type, :openstack_service_name,
9
+ :openstack_tenant, :openstack_tenant_id,
10
+ :openstack_api_key, :openstack_username, :openstack_identity_endpoint,
11
+ :current_user, :current_tenant, :openstack_region,
12
+ :openstack_endpoint_type,
13
+ :openstack_project_name, :openstack_project_id,
14
+ :openstack_project_domain, :openstack_user_domain, :openstack_domain_name,
15
+ :openstack_project_domain_id, :openstack_user_domain_id, :openstack_domain_id
12
16
 
13
17
  model_path 'fog/openstack/models/volume'
14
18
 
@@ -41,6 +45,7 @@ module Fog
41
45
 
42
46
  request :create_volume_snapshot
43
47
  request :list_snapshots
48
+ request :list_snapshots_detailed
44
49
  request :get_snapshot_details
45
50
  request :delete_snapshot
46
51
 
@@ -119,55 +124,23 @@ module Fog
119
124
  end
120
125
 
121
126
  class Real
122
- attr_reader :current_user
123
- attr_reader :current_tenant
127
+ include Fog::OpenStack::Core
124
128
 
125
129
  def initialize(options={})
126
- @openstack_auth_token = options[:openstack_auth_token]
130
+ initialize_identity options
127
131
 
128
- unless @openstack_auth_token
129
- missing_credentials = Array.new
130
- @openstack_api_key = options[:openstack_api_key]
131
- @openstack_username = options[:openstack_username]
132
+ @openstack_service_type = options[:openstack_service_type] || ['volume']
133
+ @openstack_service_name = options[:openstack_service_name]
134
+ @openstack_endpoint_type = options[:openstack_endpoint_type] || 'adminURL'
132
135
 
133
- missing_credentials << :openstack_api_key unless @openstack_api_key
134
- missing_credentials << :openstack_username unless @openstack_username
135
- raise ArgumentError, "Missing required arguments: #{missing_credentials.join(', ')}" unless missing_credentials.empty?
136
- end
137
-
138
- @openstack_tenant = options[:openstack_tenant]
139
- @openstack_auth_uri = URI.parse(options[:openstack_auth_url])
140
- @openstack_management_url = options[:openstack_management_url]
141
- @openstack_must_reauthenticate = false
142
- @openstack_service_type = options[:openstack_service_type] || ['volume']
143
- @openstack_service_name = options[:openstack_service_name]
144
- @openstack_region = options[:openstack_region]
145
-
146
- @openstack_endpoint_type = options[:openstack_endpoint_type] || 'adminURL'
147
- @connection_options = options[:connection_options] || {}
148
-
149
- @current_user = options[:current_user]
150
- @current_tenant = options[:current_tenant]
136
+ @connection_options = options[:connection_options] || {}
151
137
 
152
138
  authenticate
153
139
 
154
- @persistent = options[:persistent] || false
140
+ @persistent = options[:persistent] || false
155
141
  @connection = Fog::Core::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
156
142
  end
157
143
 
158
- def credentials
159
- { :provider => 'openstack',
160
- :openstack_auth_url => @openstack_auth_uri.to_s,
161
- :openstack_auth_token => @auth_token,
162
- :openstack_management_url => @openstack_management_url,
163
- :current_user => @current_user,
164
- :current_tenant => @current_tenant }
165
- end
166
-
167
- def reload
168
- @connection.reset
169
- end
170
-
171
144
  def request(params)
172
145
  begin
173
146
  response = @connection.request(params.merge({
@@ -202,41 +175,6 @@ module Fog
202
175
 
203
176
  private
204
177
 
205
- def authenticate
206
- if !@openstack_management_url || @openstack_must_reauthenticate
207
- options = {
208
- :openstack_region => @openstack_region,
209
- :openstack_tenant => @openstack_tenant,
210
- :openstack_api_key => @openstack_api_key,
211
- :openstack_username => @openstack_username,
212
- :openstack_auth_uri => @openstack_auth_uri,
213
- :openstack_auth_token => @openstack_must_reauthenticate ? nil : @openstack_auth_token,
214
- :openstack_service_type => @openstack_service_type,
215
- :openstack_service_name => @openstack_service_name,
216
- :openstack_endpoint_type => @openstack_endpoint_type
217
- }
218
-
219
- credentials = Fog::OpenStack.authenticate(options, @connection_options)
220
-
221
- @current_user = credentials[:user]
222
- @current_tenant = credentials[:tenant]
223
-
224
- @openstack_must_reauthenticate = false
225
- @auth_token = credentials[:token]
226
- @openstack_management_url = credentials[:server_management_url]
227
- uri = URI.parse(@openstack_management_url)
228
- else
229
- @auth_token = @openstack_auth_token
230
- uri = URI.parse(@openstack_management_url)
231
- end
232
-
233
- @host = uri.host
234
- @path = uri.path
235
- @path.sub!(/\/$/, '')
236
- @port = uri.port
237
- @scheme = uri.scheme
238
- true
239
- end
240
178
  end
241
179
  end
242
180
  end
@@ -33,8 +33,19 @@ module Fog
33
33
  hmac = Fog::HMAC.new('sha1', @rackspace_temp_url_key)
34
34
  sig = sig_to_hex(hmac.sign(string_to_sign))
35
35
 
36
- scheme = options[:scheme] ? options[:scheme] : @uri.scheme
37
- "#{scheme}://#{@uri.host}#{object_path_escaped}?temp_url_sig=#{sig}&temp_url_expires=#{expires}"
36
+ temp_url_query = {
37
+ :temp_url_sig => sig,
38
+ :temp_url_expires => expires
39
+ }
40
+ temp_url_query.merge!(:inline => true) if options[:inline]
41
+ temp_url_query.merge!(:filename => options[:filename]) if options[:filename]
42
+ temp_url_options = {
43
+ :scheme => options[:scheme] || @uri.scheme,
44
+ :host => @uri.host,
45
+ :path => object_path_escaped,
46
+ :query => temp_url_query.map { |param, val| "#{CGI.escape(param.to_s)}=#{CGI.escape(val.to_s)}" }.join('&')
47
+ }
48
+ URI::Generic.build(temp_url_options).to_s
38
49
  end
39
50
 
40
51
  private
@@ -66,12 +66,13 @@ module Fog
66
66
  xml.Netmask subnet[:Netmask]
67
67
  }
68
68
  end
69
- peer_subnet_config = tunnel_config[:PeerSubnet]
70
- xml.PeerSubnet {
71
- xml.Name peer_subnet_config[:Name]
72
- xml.Gateway peer_subnet_config[:Gateway]
73
- xml.Netmask peer_subnet_config[:Netmask]
74
- }
69
+ tunnel_config[:PeerSubnet].each do |subnet|
70
+ xml.PeerSubnet {
71
+ xml.Name subnet[:Name]
72
+ xml.Gateway subnet[:Gateway]
73
+ xml.Netmask subnet[:Netmask]
74
+ }
75
+ end
75
76
  xml.SharedSecret tunnel_config[:SharedSecret]
76
77
  xml.SharedSecretEncrypted tunnel_config[:SharedSecretEncrypted] if tunnel_config.key?(:SharedSecretEncrypted)
77
78
  xml.EncryptionProtocol tunnel_config[:EncryptionProtocol]
@@ -8,6 +8,21 @@ module Fog
8
8
  model Fog::Compute::VcloudDirector::VmCustomization
9
9
 
10
10
  attribute :vm
11
+
12
+ private
13
+
14
+ def get_by_id(item_id)
15
+ item = service.get_vm_customization(item_id).body
16
+ add_id_from_href!(item)
17
+ item
18
+ end
19
+
20
+ # The HREF returned for a VM customization object is actually the VM
21
+ # HREF suffixed with '/guestCustomizationSection/' so we cannot use
22
+ # service.add_id_from_href! like all other collections.
23
+ def add_id_from_href!(item={})
24
+ item[:id] = item[:href].gsub('/guestCustomizationSection/', '').split('/').last
25
+ end
11
26
  end
12
27
  end
13
28
  end
@@ -1,3 +1,3 @@
1
1
  module Fog
2
- VERSION = '1.33.0'
2
+ VERSION = '1.34.0'
3
3
  end
@@ -135,6 +135,7 @@ Watchers | #{watchers}
135
135
  'Nat Welch',
136
136
  'Nick Osborn',
137
137
  'nightshade427',
138
+ 'Oleg Vivtash',
138
139
  'Patrick Debois',
139
140
  'Paul Thornthwaite',
140
141
  'Paulo Henrique Lopes Ribeiro',
@@ -325,6 +325,11 @@ RSpec.describe Fog::Volume::OpenStack do
325
325
  end
326
326
 
327
327
  # TODO: tests for snapshots
328
+ it 'responds to list_snapshots_detailed' do
329
+ expect(@service.respond_to?(:list_snapshots_detailed)).to be true
330
+ end
331
+
332
+
328
333
  # TODO: tests for quotas
329
334
 
330
335
  end
@@ -13,12 +13,6 @@ def compute_providers
13
13
  },
14
14
  :mocked => false
15
15
  },
16
- :brightbox => {
17
- :server_attributes => {
18
- :image_id => Brightbox::Compute::TestSupport.image_id
19
- },
20
- :mocked => false
21
- },
22
16
  :cloudstack => {
23
17
  :provider_attributes => {
24
18
  :cloudstack_host => 'http://host.foo'
@@ -1,17 +1,18 @@
1
1
  Shindo.tests('Fog::Network[:openstack] | port requests', ['openstack']) do
2
2
 
3
3
  @port_format = {
4
- 'id' => String,
5
- 'name' => String,
6
- 'network_id' => String,
7
- 'fixed_ips' => Array,
8
- 'mac_address' => String,
9
- 'status' => String,
10
- 'admin_state_up' => Fog::Boolean,
11
- 'device_owner' => String,
12
- 'device_id' => String,
13
- 'tenant_id' => String,
14
- 'security_groups' => Array,
4
+ 'id' => String,
5
+ 'name' => String,
6
+ 'network_id' => String,
7
+ 'fixed_ips' => Array,
8
+ 'mac_address' => String,
9
+ 'status' => String,
10
+ 'admin_state_up' => Fog::Boolean,
11
+ 'device_owner' => String,
12
+ 'device_id' => String,
13
+ 'tenant_id' => String,
14
+ 'security_groups' => Array,
15
+ 'allowed_address_pairs' => Array
15
16
  }
16
17
 
17
18
  tests('success') do
@@ -20,7 +21,8 @@ Shindo.tests('Fog::Network[:openstack] | port requests', ['openstack']) do
20
21
  attributes = {:name => 'port_name', :fixed_ips => [],
21
22
  :mac_address => 'fa:16:3e:62:91:7f', :admin_state_up => true,
22
23
  :device_owner => 'device_owner', :device_id => 'device_id',
23
- :tenant_id => 'tenant_id' ,:security_groups => [] }
24
+ :tenant_id => 'tenant_id' ,:security_groups => [],
25
+ :allowed_address_pairs => [] }
24
26
  Fog::Network[:openstack].create_port(network_id, attributes).body
25
27
  end
26
28
 
@@ -1,3 +1,6 @@
1
+ require 'uri'
2
+ require 'cgi'
3
+
1
4
  Shindo.tests('Fog::Storage[:rackspace] | object requests', ["rackspace"]) do
2
5
 
3
6
  @directory = Fog::Storage[:rackspace].directories.create(:key => 'fogobjecttests')
@@ -8,6 +11,21 @@ Shindo.tests('Fog::Storage[:rackspace] | object requests', ["rackspace"]) do
8
11
  end
9
12
  end
10
13
 
14
+ def parse_url(url_string)
15
+ uri = URI.parse(url_string)
16
+ query_hash = CGI.parse(uri.query)
17
+ query_hash.each do |k, v|
18
+ query_hash[k] = v[0] if query_hash[k].is_a?(Array) and query_hash[k].count == 1
19
+ end
20
+ {
21
+ :scheme => uri.scheme,
22
+ :host => uri.host,
23
+ :port => uri.port,
24
+ :path => uri.path,
25
+ :query => query_hash
26
+ }
27
+ end
28
+
11
29
  tests('success') do
12
30
 
13
31
  tests("#put_object('fogobjecttests', 'fog_object')").succeeds do
@@ -41,7 +59,13 @@ Shindo.tests('Fog::Storage[:rackspace] | object requests', ["rackspace"]) do
41
59
  storage.extend RackspaceStorageHelpers
42
60
  storage.override_path('/fake_version/fake_tenant')
43
61
  object_url = storage.get_object_http_url('fogobjecttests', 'fog_object', expires_at)
44
- object_url =~ /http:\/\/.*clouddrive.com\/[^\/]+\/[^\/]+\/fogobjecttests\/fog_object\?temp_url_sig=7e69a73092e333095a70b3be826a7350fcbede86&temp_url_expires=1344149532/
62
+ url = parse_url(object_url)
63
+ [
64
+ url[:host] =~ /.*clouddrive\.com$/,
65
+ url[:path] =~ /\/fogobjecttests\/fog_object$/,
66
+ url[:query]['temp_url_sig'] == '7e69a73092e333095a70b3be826a7350fcbede86',
67
+ url[:query]['temp_url_expires'] == '1344149532'
68
+ ].all?
45
69
  end
46
70
 
47
71
  # an object key with no special characters
@@ -51,7 +75,13 @@ Shindo.tests('Fog::Storage[:rackspace] | object requests', ["rackspace"]) do
51
75
  storage.extend RackspaceStorageHelpers
52
76
  storage.override_path('/fake_version/fake_tenant')
53
77
  object_url = storage.get_object_https_url('fogobjecttests', 'fog_object', expires_at)
54
- object_url =~ /https:\/\/.*clouddrive.com\/[^\/]+\/[^\/]+\/fogobjecttests\/fog_object\?temp_url_sig=7e69a73092e333095a70b3be826a7350fcbede86&temp_url_expires=1344149532/
78
+ url = parse_url(object_url)
79
+ [
80
+ url[:host] =~ /.*clouddrive\.com$/,
81
+ url[:path] =~ /\/fogobjecttests\/fog_object$/,
82
+ url[:query]['temp_url_sig'] == '7e69a73092e333095a70b3be826a7350fcbede86',
83
+ url[:query]['temp_url_expires'] == '1344149532'
84
+ ].all?
55
85
  end
56
86
 
57
87
  # an object key nested under a /
@@ -61,7 +91,13 @@ Shindo.tests('Fog::Storage[:rackspace] | object requests', ["rackspace"]) do
61
91
  storage.extend RackspaceStorageHelpers
62
92
  storage.override_path('/fake_version/fake_tenant')
63
93
  object_url = storage.get_object_https_url('fogobjecttests', 'fog/object', expires_at)
64
- object_url =~ /https:\/\/.*clouddrive.com\/[^\/]+\/[^\/]+\/fogobjecttests\/fog\/object\?temp_url_sig=3e99892828804e3d0fdadd18c543b688591ca8b8&temp_url_expires=1344149532/
94
+ url = parse_url(object_url)
95
+ [
96
+ url[:host] =~ /.*clouddrive\.com$/,
97
+ url[:path] =~ /\/fogobjecttests\/fog\/object$/,
98
+ url[:query]['temp_url_sig'] == '3e99892828804e3d0fdadd18c543b688591ca8b8',
99
+ url[:query]['temp_url_expires'] == '1344149532'
100
+ ].all?
65
101
  end
66
102
 
67
103
  # an object key containing a -
@@ -71,7 +107,13 @@ Shindo.tests('Fog::Storage[:rackspace] | object requests', ["rackspace"]) do
71
107
  storage.extend RackspaceStorageHelpers
72
108
  storage.override_path('/fake_version/fake_tenant')
73
109
  object_url = storage.get_object_https_url('fogobjecttests', 'fog-object', expires_at)
74
- object_url =~ /https:\/\/.*clouddrive.com\/[^\/]+\/[^\/]+\/fogobjecttests\/fog-object\?temp_url_sig=a24dd5fc955a57adce7d1b5bc4ec2c7660ab8396&temp_url_expires=1344149532/
110
+ url = parse_url(object_url)
111
+ [
112
+ url[:host] =~ /.*clouddrive\.com$/,
113
+ url[:path] =~ /\/fogobjecttests\/fog-object$/,
114
+ url[:query]['temp_url_sig'] == 'a24dd5fc955a57adce7d1b5bc4ec2c7660ab8396',
115
+ url[:query]['temp_url_expires'] == '1344149532'
116
+ ].all?
75
117
  end
76
118
 
77
119
  tests("put_object with block") do