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 +4 -4
- data/lib/fog/google.rb +4 -1
- data/lib/fog/google/models/compute/backend_service.rb +4 -5
- data/lib/fog/google/models/compute/backend_services.rb +5 -1
- data/lib/fog/google/models/compute/http_health_checks.rb +1 -1
- data/lib/fog/google/version.rb +1 -1
- data/tests/models/compute/backend_service_tests.rb +2 -1
- data/tests/models/compute/backend_services_tests.rb +1 -1
- data/tests/models/compute/image_tests.rb +1 -1
- data/tests/models/compute/images_tests.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d34bfdbe9d48d888a666b8097dafa7246fc8ab6f
|
4
|
+
data.tar.gz: 3319d90e425fdf1f9d53d3f3ff06e5b5473f8558
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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=
|
40
|
+
def destroy(async=true)
|
41
41
|
requires :name
|
42
42
|
|
43
|
-
|
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
|
-
|
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
|
-
|
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
|
data/lib/fog/google/version.rb
CHANGED
@@ -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 = '
|
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 = '
|
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
|