bosh_cpi 1.2976.0 → 1.2977.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bosh/cpi/cli.rb +16 -12
- data/lib/cloud/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75aa621a2ca92bc9ab26b3a7294bc2a26687e061
|
4
|
+
data.tar.gz: e41ca194a2b98a8416385308b4a2102ae6376520
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 384dc32c5ae1349ca7e845cbaee6c6be0accb4c2c119337c88d5583c20cc814a4f6e076a3183b01feb7272205c184a24b4a5e1cd042616bc556422d8ffdf4566
|
7
|
+
data.tar.gz: b400262502c978c31dcde835a899c6663e113ef21e2673f2c5eee8ffc8079a53e3a32951deecb37f63fdbb43c166522cf8dae8ab4afe14baa107b7fc296227f3
|
data/lib/bosh/cpi/cli.rb
CHANGED
@@ -39,27 +39,27 @@ class Bosh::Cpi::Cli
|
|
39
39
|
def run(json)
|
40
40
|
begin
|
41
41
|
request = JSON.load(json)
|
42
|
-
rescue JSON::ParserError
|
43
|
-
return error_response(INVALID_CALL_ERROR_TYPE,
|
42
|
+
rescue JSON::ParserError => e
|
43
|
+
return error_response(INVALID_CALL_ERROR_TYPE, "Request cannot be deserialized, details: #{e.message}", false, e.backtrace)
|
44
44
|
end
|
45
45
|
|
46
46
|
method = request['method']
|
47
47
|
unless method.is_a?(String)
|
48
|
-
return error_response(INVALID_CALL_ERROR_TYPE,
|
48
|
+
return error_response(INVALID_CALL_ERROR_TYPE, "Method must be a String, got: '#{method.inspect}'", false)
|
49
49
|
end
|
50
50
|
|
51
51
|
unless KNOWN_RPC_METHODS.include?(method)
|
52
|
-
return error_response(INVALID_CALL_ERROR_TYPE,
|
52
|
+
return error_response(INVALID_CALL_ERROR_TYPE, "Method is not known, got: '#{method}'", false)
|
53
53
|
end
|
54
54
|
|
55
55
|
arguments = request['arguments']
|
56
56
|
unless arguments.is_a?(Array)
|
57
|
-
return error_response(INVALID_CALL_ERROR_TYPE,
|
57
|
+
return error_response(INVALID_CALL_ERROR_TYPE, "Arguments must be an Array, got: '#{arguments.inspect}'", false)
|
58
58
|
end
|
59
59
|
|
60
60
|
context = request['context']
|
61
61
|
unless context.is_a?(Hash) && context['director_uuid'].is_a?(String)
|
62
|
-
return error_response(INVALID_CALL_ERROR_TYPE,
|
62
|
+
return error_response(INVALID_CALL_ERROR_TYPE, "Request should include context with director uuid, got: '#{context.inspect}'", false)
|
63
63
|
end
|
64
64
|
|
65
65
|
configure_director(context['director_uuid'])
|
@@ -69,13 +69,13 @@ class Bosh::Cpi::Cli
|
|
69
69
|
begin
|
70
70
|
result = @cpi.public_send(ruby_method, *arguments)
|
71
71
|
rescue Bosh::Clouds::RetriableCloudError => e
|
72
|
-
return error_response(error_name(e), e.message, e.ok_to_retry)
|
72
|
+
return error_response(error_name(e), e.message, e.ok_to_retry, e.backtrace)
|
73
73
|
rescue Bosh::Clouds::CloudError, Bosh::Clouds::CpiError => e
|
74
|
-
return error_response(error_name(e), e.message, false)
|
75
|
-
rescue ArgumentError
|
76
|
-
return error_response(INVALID_CALL_ERROR_TYPE,
|
74
|
+
return error_response(error_name(e), e.message, false, e.backtrace)
|
75
|
+
rescue ArgumentError => e
|
76
|
+
return error_response(INVALID_CALL_ERROR_TYPE, "Arguments are not correct, details: '#{e.message}'", false, e.backtrace)
|
77
77
|
rescue Exception => e
|
78
|
-
return error_response(UNKNOWN_ERROR_TYPE, e.message, false)
|
78
|
+
return error_response(UNKNOWN_ERROR_TYPE, e.message, false, e.backtrace)
|
79
79
|
end
|
80
80
|
|
81
81
|
result_response(result)
|
@@ -87,7 +87,11 @@ class Bosh::Cpi::Cli
|
|
87
87
|
Bosh::Clouds::Config.uuid = director_uuid
|
88
88
|
end
|
89
89
|
|
90
|
-
def error_response(type, message, ok_to_retry)
|
90
|
+
def error_response(type, message, ok_to_retry, bt=[])
|
91
|
+
if !bt.empty?
|
92
|
+
@logs_string_io.print("Rescued #{type}: #{message}. backtrace: #{bt.join("\n")}")
|
93
|
+
end
|
94
|
+
|
91
95
|
hash = {
|
92
96
|
result: nil,
|
93
97
|
error: {
|
data/lib/cloud/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh_cpi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2977.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VMware
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bosh_common
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.2977.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.2977.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: membrane
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,7 +96,7 @@ dependencies:
|
|
96
96
|
version: '0'
|
97
97
|
description: |-
|
98
98
|
BOSH CPI
|
99
|
-
|
99
|
+
5a4f6d
|
100
100
|
email: support@cloudfoundry.com
|
101
101
|
executables: []
|
102
102
|
extensions: []
|