vm_shepherd 0.7.0 → 0.7.1

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: 44b185c8635a7ee3bffac7c3a36faa3ab6e0fe50
4
- data.tar.gz: 9164bb10195596eabd453c1d136f11a56450ee1c
3
+ metadata.gz: e40010121984be566b3f88a3e7d12984223d10df
4
+ data.tar.gz: 85e3ec192349a2a70de3612dcde0ec982edec9f0
5
5
  SHA512:
6
- metadata.gz: 107bf1e783e05dc640d0fce0469bd7df0b26fc9f40cb828f944be46aafd4e5e7d67d86391d40980e28ebea1a8866e9ce9237bc651778ec30ba6005124d6bf671
7
- data.tar.gz: d1bd3e71af415e4262c817687f929bda22f38696d637bea25d513452f119cdef660542fecc29f4a4a95894c2187aa5b09ebfd70263e46b1dca77bf58232856ac
6
+ metadata.gz: a0afc08340253f1d54b01762c960f1e879ca367e6ecb6fa0d47bd19e9cef67566f820131af993db862c082b03fa51333369a65d5735cbecce62fddb106a2ad22
7
+ data.tar.gz: bea513f347e77b7fee6cf95404a9f4a17e7f20acf881bd40a785c4c3163f43a19a4e563e4b169b01cc6f8a5c166da882cd37594efdf303e66b0418871ae7aa33
@@ -1,3 +1,3 @@
1
1
  module VmShepherd
2
- VERSION = '0.7.0'.freeze
2
+ VERSION = '0.7.1'.freeze
3
3
  end
@@ -57,8 +57,8 @@ module VmShepherd
57
57
  end
58
58
 
59
59
  def destroy(ip_address, resource_pool_name)
60
- vms = connection.serviceContent.searchIndex.FindAllByIp(ip: ip_address, vmSearch: true).
61
- select { |vm| vm.resourcePool.name == resource_pool_name }
60
+ vms = connection.serviceContent.searchIndex.FindAllByIp(ip: ip_address, vmSearch: true)
61
+ vms = vms.select { |vm| resource_pool_name == vm.resourcePool.name } if resource_pool_name
62
62
  vms.each do |vm|
63
63
  power_off_vm(vm)
64
64
  destroy_vm(vm)
@@ -42,6 +42,19 @@ module VmShepherd
42
42
  vsphere_manager.destroy(ip_address, 'second_resource_pool')
43
43
  end
44
44
 
45
+ it 'destroys the VM that matches the given ip address only when resource pool nil' do
46
+ expect(vsphere_manager).to receive(:power_off_vm).with(vm1)
47
+ expect(vsphere_manager).to receive(:destroy_vm).with(vm1)
48
+
49
+ expect(vsphere_manager).to receive(:power_off_vm).with(vm2)
50
+ expect(vsphere_manager).to receive(:destroy_vm).with(vm2)
51
+
52
+ expect(vsphere_manager).to receive(:power_off_vm).with(vm3)
53
+ expect(vsphere_manager).to receive(:destroy_vm).with(vm3)
54
+
55
+ vsphere_manager.destroy(ip_address, nil)
56
+ end
57
+
45
58
  context 'when there are no vms with that IP address' do
46
59
  let(:vms) { [] }
47
60
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vm_shepherd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ops Manager Team