Bug #18366
closedvSphere: exception raised when vm cannot be created correctly
Description
NoMethodError: undefined method `include?' for nil:NilClass | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-1.0.0/lib/fog/vsphere/requests/compute/get_virtual_machine.rb:40:in `get_vm_by_name' | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-1.0.0/lib/fog/vsphere/requests/compute/get_virtual_machine.rb:25:in `block in get_vm_ref' | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-1.0.0/lib/fog/vsphere/requests/compute/get_virtual_machine.rb:25:in `map' | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-1.0.0/lib/fog/vsphere/requests/compute/get_virtual_machine.rb:25:in `get_vm_ref' | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-1.0.0/lib/fog/vsphere/requests/compute/get_virtual_machine.rb:7:in `get_virtual_machine' | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-1.0.0/lib/fog/vsphere/models/compute/servers.rb:31:in `get' | /usr/share/foreman/app/models/compute_resource.rb:169:in `find_vm_by_uuid' | /usr/share/foreman/app/models/compute_resource.rb:187:in `destroy_vm' | /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:399:in `rescue in create_vm' | /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:386:in `create_vm' | /usr/share/foreman/app/models/concerns/orchestration/compute.rb:82:in `setCompute'
rescue block in create_vm should check if vm.id is not nil