bosh_vsphere_cpi 1.2891.0 → 1.2902.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cloud/vsphere/client.rb +12 -4
- data/lib/cloud/vsphere/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8476afad7bad1192d764778265348d8a31ec60d9
|
4
|
+
data.tar.gz: ad2c4d1f695e444660d4e765db47a3c0f7f89b7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3409e451fde5a32cdaa22e092abe8211046207ebc2f35bfdfae60b667a2999bc6aa1d8329dfb2a72595459796afcf1c8a10bfc7690d1b68da81a17538a31cdfd
|
7
|
+
data.tar.gz: 79ff48d380c07d508b12ab1935a0f873d6eafa2f46eacd0a7592817efd9fb00351ebbf8642865a64dc43760d4dd3508e59760c17553161a51953c197b7805a7b
|
data/lib/cloud/vsphere/client.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
module VSphereCloud
|
2
|
-
|
3
2
|
class Client
|
4
3
|
include VimSdk
|
4
|
+
|
5
|
+
class TaskException < StandardError; end
|
6
|
+
class FileNotFoundException < TaskException; end
|
5
7
|
class AlreadyLoggedInException < StandardError; end
|
6
8
|
class NotLoggedInException < StandardError; end
|
7
9
|
|
@@ -171,7 +173,7 @@ module VSphereCloud
|
|
171
173
|
when Vim::TaskInfo::State::SUCCESS
|
172
174
|
return properties["info.result"]
|
173
175
|
when Vim::TaskInfo::State::ERROR
|
174
|
-
raise properties["info.error"]
|
176
|
+
raise task_exception_for_vim_fault(properties["info.error"])
|
175
177
|
end
|
176
178
|
end
|
177
179
|
end
|
@@ -258,14 +260,20 @@ module VSphereCloud
|
|
258
260
|
search_spec.query = [query]
|
259
261
|
|
260
262
|
vm_disk_infos = wait_for_task(datastore.mob.browser.search("[#{datastore.name}] #{disk_folder}", search_spec)).file
|
261
|
-
|
262
263
|
return nil if vm_disk_infos.empty?
|
263
264
|
|
264
265
|
vm_disk_infos.first.capacity_kb / 1024
|
265
|
-
rescue VimSdk::SoapError
|
266
|
+
rescue VimSdk::SoapError, FileNotFoundException
|
266
267
|
nil
|
267
268
|
end
|
268
269
|
|
270
|
+
def task_exception_for_vim_fault(fault)
|
271
|
+
exceptions_by_fault = {
|
272
|
+
VimSdk::Vim::Fault::FileNotFound => FileNotFoundException,
|
273
|
+
}
|
274
|
+
exceptions_by_fault.fetch(fault.class, TaskException).new(fault.msg)
|
275
|
+
end
|
276
|
+
|
269
277
|
def find_perf_metric_names(mob, names)
|
270
278
|
@lock.synchronize do
|
271
279
|
unless @metrics_cache.has_key?(mob.class)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh_vsphere_cpi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2902.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-03-
|
11
|
+
date: 2015-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bosh_common
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.2902.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.2902.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bosh_cpi
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.2902.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.2902.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: membrane
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -208,7 +208,7 @@ dependencies:
|
|
208
208
|
version: '0'
|
209
209
|
description: |-
|
210
210
|
BOSH VSphere CPI
|
211
|
-
|
211
|
+
ac0a41
|
212
212
|
email: support@cloudfoundry.com
|
213
213
|
executables:
|
214
214
|
- vsphere_cpi
|