diff --git a/src/vmm_mad/remotes/lib/vcenter_driver/host.rb b/src/vmm_mad/remotes/lib/vcenter_driver/host.rb index 0d5ce10ce5..f9377c88fd 100644 --- a/src/vmm_mad/remotes/lib/vcenter_driver/host.rb +++ b/src/vmm_mad/remotes/lib/vcenter_driver/host.rb @@ -509,8 +509,9 @@ class ClusterComputeResource str_info << "POLL=\"#{vm.info.gsub('"', "\\\"")}\"]" rescue Exception => e - STDERR.puts e.inspect - STDERR.puts e.backtrace + tmp_str = e.inspect + tmp_str << e.backtrace.join("\n") + str_info << "ERROR=\"#{Base64.encode64(tmp_str).gsub("\n","")}\"]" end end diff --git a/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb b/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb index b994bfa121..e72a738dc5 100644 --- a/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb +++ b/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb @@ -852,7 +852,9 @@ class Template str << "IMPORT_STATE =\"#{@state}\"\n" # Get DS information - if !@vm_info["datastore"].last._ref.nil? + if !@vm_info["datastore"].nil? + !@vm_info["datastore"].last.nil? && + !@vm_info["datastore"].last._ref.nil? str << "VCENTER_DS_REF = \"#{@vm_info["datastore"].last._ref}\"\n" end