fog-google 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d4cdb744e462698db3a86387dda02b2a0f824770
4
- data.tar.gz: dfe92b3f8aad70f7e32052023b5f6c87e6f53d03
3
+ metadata.gz: d34bfdbe9d48d888a666b8097dafa7246fc8ab6f
4
+ data.tar.gz: 3319d90e425fdf1f9d53d3f3ff06e5b5473f8558
5
5
  SHA512:
6
- metadata.gz: 12ecf2148f5534ddde97f71432c7c8c4d4f080b266454d84d3d116cf5acab7d0a18256cc496744ef8f786b6badfec50be52c09e4934230c40558c136a40406cb
7
- data.tar.gz: 3454bf53193dc44d67b7ada9b37a7fb6d7bb3e586b730ac50a1fbb4353ce19ffbc374ba7b31e0861c0927bd01fd7298701f70ec6bdebcf3a90eb073bc62b8d42
6
+ metadata.gz: 14805dd5f5e1e0d4411c971b43b6c5cce08692be4a512f5e07c008462f26e6f1dbaa5791110fde190115b5a481c8ef7029a2345c7248c42b156ac48a3ebf0b4a
7
+ data.tar.gz: a23a1dc7faaa20c0887fe4419a6b6f15d21b96094aa41a31826eb7895ae7295b35d241d6dee14436baf4ca8451be524fb498edfdffc654dc32a1bf1d287a2d81
data/lib/fog/google.rb CHANGED
@@ -183,7 +183,10 @@ module Fog
183
183
  :api_method => api_method,
184
184
  :parameters => parameters,
185
185
  }
186
- client_parms[:body_object] = body_object if body_object
186
+ # The Google API complains when given null values for enums, so just don't pass it any null fields
187
+ # XXX It may still balk if we have a nested object, e.g.:
188
+ # {:a_field => "string", :a_nested_field => { :an_empty_nested_field => nil } }
189
+ client_parms[:body_object] = body_object.reject { |k, v| v.nil? } if body_object
187
190
 
188
191
  result = @client.execute(client_parms)
189
192
 
@@ -37,14 +37,13 @@ module Fog
37
37
  reload
38
38
  end
39
39
 
40
- def destroy(async=false)
40
+ def destroy(async=true)
41
41
  requires :name
42
42
 
43
- operation = service.delete_backend_service(name)
43
+ data = service.delete_backend_service(name)
44
+ operation = Fog::Compute::Google::Operations.new(:service => service).get(data.body['name'])
44
45
  unless async
45
- Fog.wait_for do
46
- operation.body["status"] == "DONE"
47
- end
46
+ operation.wait_for { ready? }
48
47
  end
49
48
  operation
50
49
  end
@@ -13,8 +13,12 @@ module Fog
13
13
  end
14
14
 
15
15
  def get(identity)
16
+ response = nil
16
17
  response = service.get_backend_service(identity)
17
- new(response.body) unless response.nil?
18
+ return nil if response.nil?
19
+ new(response.body)
20
+ rescue Fog::Errors::NotFound
21
+ nil
18
22
  end
19
23
  end
20
24
  end
@@ -13,7 +13,7 @@ module Fog
13
13
  end
14
14
 
15
15
  def get(identity)
16
- resonse = nil
16
+ response = nil
17
17
  response = service.get_http_health_check(identity)
18
18
  return nil if response.nil?
19
19
  new(response.body)
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Google
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -1,6 +1,7 @@
1
1
  require 'securerandom'
2
2
  Shindo.tests("Fog::Compute[:google] | backend service model", ['google']) do
3
3
  random_string = SecureRandom.hex
4
+ @health_check = create_test_http_health_check(Fog::Compute[:google])
4
5
  model_tests(Fog::Compute[:google].backend_services, {:name => "fog-test-backend-service-#{random_string}",
5
- :health_checks => [@health_check]})
6
+ :health_checks => [@health_check.self_link]})
6
7
  end
@@ -3,6 +3,6 @@ Shindo.tests("Fog::Compute[:google] | backend_services model", ['google']) do
3
3
  random_string = SecureRandom.hex
4
4
  @health_check = create_test_http_health_check(Fog::Compute[:google])
5
5
  collection_tests(Fog::Compute[:google].backend_services, {:name => "fog-backend-services-test-#{random_string}",
6
- :health_checks => [@health_check]})
6
+ :health_checks => [@health_check.self_link]})
7
7
 
8
8
  end
@@ -1,6 +1,6 @@
1
1
  require 'securerandom'
2
2
  Shindo.tests("Fog::Compute[:google] | image model", ['google']) do
3
3
  random_string = SecureRandom.hex
4
- source = 'https://www.google.com/images/srpr/logo4w.png'
4
+ source = 'http://storage.googleapis.com/fog-test-bucket/fog-test-raw-disk-source.image.tar.gz'
5
5
  model_tests(Fog::Compute[:google].images, {:name => "fog-test-images-#{random_string}", "rawDisk" => { "source" => source } })
6
6
  end
@@ -1,6 +1,6 @@
1
1
  require 'securerandom'
2
2
  Shindo.tests("Fog::Compute[:google] | images model", ['google']) do
3
3
  random_string = SecureRandom.hex
4
- source = 'https://www.google.com/images/srpr/logo4w.png'
4
+ source = 'http://storage.googleapis.com/fog-test-bucket/fog-test-raw-disk-source.image.tar.gz'
5
5
  collection_tests(Fog::Compute[:google].images, {:name => "fog-test-images-#{random_string}", "rawDisk" => { "source" => source } })
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-google
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nat Welch