Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/fog/vsphere/models/compute/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,11 @@ def customvalues
end

def scsi_controllers
attributes[:scsi_controllers] ||= service.list_vm_scsi_controllers(id)
attributes[:scsi_controllers] ||= id.nil? ? [] : service.list_vm_scsi_controllers(id)
end

def nvme_controllers
attributes[:nvme_controllers] ||= service.list_vm_nvme_controllers(id)
attributes[:nvme_controllers] ||= id.nil? ? [] : service.list_vm_nvme_controllers(id)
end

def scsi_controller
Expand Down
4 changes: 4 additions & 0 deletions lib/fog/vsphere/requests/compute/get_virtual_machine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ module Vsphere
class Compute
class Real
def get_virtual_machine(id, datacenter_name = nil, folder = nil, recursive = false)
raise(Fog::Vsphere::Compute::NotFound, "The id of the virtual machine can't be nil") if id.nil?

# The larger the VM list the longer it will take if not searching based on UUID.
convert_vm_mob_ref_to_attr_hash(get_vm_ref(id, datacenter_name, folder, recursive))
end

protected

def get_vm_ref(id, dc = nil, folder = nil, recursive = false)
raise(Fog::Vsphere::Compute::NotFound, "The id of the virtual machine can't be nil") if id.nil?

raw_datacenter = find_raw_datacenter(dc) if dc
vm = case is_uuid?(id)
# UUID based
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/vsphere/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Fog
module Vsphere
VERSION = '3.7.1'.freeze
VERSION = '3.7.2'.freeze
end
end
Loading