bosh_vsphere_cpi 1.2652.0 → 1.2657.0

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: d34426aaeb73b4a463810d492dbd6c17d7a9ec67
4
- data.tar.gz: 389890d9aab67d3e5009edf679ab9872ae614324
3
+ metadata.gz: 830117bfa34478cf66609ad0662380755df39663
4
+ data.tar.gz: e6e5313e6199ac88a496eaf433f7cd455ec6e556
5
5
  SHA512:
6
- metadata.gz: a53a6f593ecc93a495afff7a8b9c6bcaf99bde0ebb11808ef9142078114461db42425b413c7ae15fe582188af566b41a56b0ea4e97c8a7028a7540c1a13b4d15
7
- data.tar.gz: f6d4df0690286cfc8ea32597ba73ebc0ef8a36d61294777bf1e49665ba9b28cda4ac62c001db0def8280c8934969a449df34ebd2e63baa0ef66a9c6a9b17aa75
6
+ metadata.gz: 5d92517dd6042aea7c2a0a851f46969e082b74cbc589ef2be178388c9c2a7dac818825c3e7d3fdbda0fee2f804a7ebcb675656addaa9dd48fd0197be4ba3a507
7
+ data.tar.gz: 779f2888b44a23173adb147a1cc921c2a37664e0323d8d86095a75b8214703dd0734859a49cd45261e15cc6d4bd95234df7cd0243ef473f941303f0b21a170dc
@@ -10,7 +10,9 @@ module VSphereCloud
10
10
 
11
11
  def get_current_env(vm, datacenter_name)
12
12
  cdrom = @client.get_cdrom_device(vm)
13
- env_iso_folder = File.dirname(cdrom.backing.file_name)
13
+ env_iso_folder = env_iso_folder(cdrom)
14
+ return unless env_iso_folder
15
+
14
16
  datastore_name = cdrom.backing.datastore.name
15
17
  env_path = env_iso_folder.match(/\[#{datastore_name}\] (.*)/)[1]
16
18
 
@@ -34,6 +36,11 @@ module VSphereCloud
34
36
  update_cdrom_env(vm, datastore, file_name)
35
37
  end
36
38
 
39
+ def env_iso_folder(cdrom_device)
40
+ return unless cdrom_device && cdrom_device.backing.respond_to?(:file_name)
41
+ File.dirname(cdrom_device.backing.file_name)
42
+ end
43
+
37
44
  private
38
45
 
39
46
  def update_cdrom_env(vm, datastore, file_name)
@@ -46,8 +53,7 @@ module VSphereCloud
46
53
  connect_info.start_connected = true
47
54
  connect_info.connected = true
48
55
 
49
- devices = vm.config.hardware.device
50
- cdrom = devices.find { |device| device.kind_of?(Vim::Vm::Device::VirtualCdrom) }
56
+ cdrom = @client.get_cdrom_device(vm)
51
57
  cdrom.connectable = connect_info
52
58
  cdrom.backing = backing_info
53
59
 
@@ -79,9 +85,9 @@ module VSphereCloud
79
85
 
80
86
  def clean_up_old_env(vm)
81
87
  cdrom = @client.get_cdrom_device(vm)
82
- return unless cdrom && cdrom.backing.respond_to?(:file_name)
88
+ env_iso_folder = env_iso_folder(cdrom)
89
+ return unless env_iso_folder
83
90
 
84
- env_iso_folder = File.dirname(cdrom.backing.file_name)
85
91
  datacenter = @client.find_parent(vm, Vim::Datacenter)
86
92
 
87
93
  @client.delete_path(datacenter, File.join(env_iso_folder, 'env.json'))
@@ -238,10 +238,12 @@ module VSphereCloud
238
238
 
239
239
  # Delete env.iso and VM specific files managed by the director
240
240
  retry_block do
241
- cdrom_device = devices.find { |device| device.kind_of?(Vim::Vm::Device::VirtualCdrom) }
242
- if cdrom_device
243
- env_iso_folder = File.dirname(cdrom_device.backing.file_name)
244
- client.delete_path(datacenter, env_iso_folder)
241
+ cdrom = devices.find { |device| device.kind_of?(Vim::Vm::Device::VirtualCdrom) }
242
+ if cdrom
243
+ env_iso_folder = @agent_env.env_iso_folder(cdrom)
244
+ if env_iso_folder
245
+ client.delete_path(datacenter, env_iso_folder)
246
+ end
245
247
  end
246
248
  end
247
249
  end
@@ -1,7 +1,7 @@
1
1
  module Bosh
2
2
  module Clouds
3
3
  class VSphere
4
- VERSION = '1.2652.0'
4
+ VERSION = '1.2657.0'
5
5
  end
6
6
  end
7
7
  end
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.2652.0
4
+ version: 1.2657.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - VMware
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-19 00:00:00.000000000 Z
11
+ date: 2014-07-24 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.2652.0
19
+ version: 1.2657.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.2652.0
26
+ version: 1.2657.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.2652.0
33
+ version: 1.2657.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.2652.0
40
+ version: 1.2657.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: membrane
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -138,7 +138,7 @@ dependencies:
138
138
  version: 2.2.4
139
139
  description: |-
140
140
  BOSH VSphere CPI
141
- 43d2e8
141
+ a6c527
142
142
  email: support@cloudfoundry.com
143
143
  executables:
144
144
  - vsphere_cpi