lib/fog/vsphere/compute.rb in fog-1.8.0 vs lib/fog/vsphere/compute.rb in fog-1.9.0

- old
+ new

@@ -57,10 +57,11 @@ request :get_virtual_machine request :vm_reconfig_hardware request :vm_reconfig_memory request :vm_reconfig_cpus request :vm_config_vnc + request :create_folder module Shared attr_reader :vsphere_is_vcenter attr_reader :vsphere_rev @@ -121,10 +122,12 @@ end end # This inline rescue catches any standard error. While a VM is # cloning, a call to the macs method will throw and NoMethodError attrs['mac_addresses'] = vm_mob_ref.macs rescue nil - attrs['path'] = get_folder_path(vm_mob_ref.parent) + # Rescue nil to catch testing while vm_mob_ref isn't reaL?? + attrs['path'] = "/"+vm_mob_ref.parent.path.map(&:last).join('/') rescue nil + attrs['relative_path'] = (attrs['path'].split('/').reject {|e| e.empty?} - ["Datacenters", attrs['datacenter'], "vm"]).join("/") rescue nil end end # returns the parent object based on a type # provides both real RbVmomi object and its name.