1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

F #4913: Pass tm action error message to the driver (ERROR attr) so you don't have to look for it in the log

This commit is contained in:
mcabrerizo 2017-04-18 10:21:58 +02:00
parent 1aaf04e45c
commit 179bf23d9b
5 changed files with 19 additions and 13 deletions

View File

@ -115,9 +115,10 @@ begin
end
rescue Exception => e
STDERR.puts "Error clone virtual disk #{src_path} in "\
"datastore #{target_ds_name_vc}. "\
"Reason: #{e.message}\n#{e.backtrace}"
message = "Error clone virtual disk #{src_path} in "\
"datastore #{target_ds_name_vc}. "\
"Reason: #{e.message}\n#{e.backtrace}"
STDERR.puts error_message(message)
exit -1
ensure
vi_client.close_connection if vi_client

View File

@ -101,8 +101,9 @@ begin
source_ds_vc.copy_virtual_disk(src_path, target_ds_vc, target_path)
rescue Exception => e
STDERR.puts "Error copying img #{src_path} to #{target_ds_name_vc} "\
"Reason: #{e.message}\n#{e.backtrace}"
message = "Error copying img #{src_path} to #{target_ds_name_vc} "\
"Reason: #{e.message}\n#{e.backtrace}"
STDERR.puts error_message(message)
exit -1
ensure
vi_client.close_connection if vi_client

View File

@ -115,8 +115,9 @@ if path.match(/disk\.\d+$/)
end
rescue Exception => e
STDERR.puts "Error delete virtual disk #{img_path} in datastore #{dsid}."\
" Reason: #{e.message}\n#{e.backtrace}"
message = "Error delete virtual disk #{img_path} in datastore #{dsid}."\
" Reason: #{e.message}\n#{e.backtrace}"
STDERR.puts error_message(message)
exit -1
ensure
vi_client.close_connection if vi_client
@ -253,8 +254,9 @@ else
# Destroy the VM unless the instantiate as persistent is used
vm.destroy if !vm.instantiated_as_persistent?
rescue Exception => e
STDERR.puts "Error unregistering vm #{vmid} (#{vm_ref})."\
" Reason: #{e.message}\n#{e.backtrace}"
message = "Error unregistering vm #{vmid} (#{vm_ref})."\
" Reason: #{e.message}\n#{e.backtrace}"
STDERR.puts error_message(message)
exit -1
ensure
vi_client.close_connection if vi_client

View File

@ -86,8 +86,9 @@ begin
end
rescue Exception => e
STDERR.puts "Error creating virtual disk in #{ds_vc['name']}."\
" Reason: #{e.message}\n#{e.backtrace}"
message = "Error creating virtual disk in #{ds_vc['name']}."\
" Reason: #{e.message}\n#{e.backtrace}"
STDERR.puts error_message(message)
exit -1
ensure
vi_client.close_connection if vi_client

View File

@ -69,8 +69,9 @@ begin
vm.detach_disk(disk) if !vm.has_snapshots? && !vm.instantiated_as_persistent?
rescue Exception => e
STDERR.puts "Error detaching virtual disk #{disk_id} from vm #{vmid}."\
" Reason: #{e.message}\n#{e.backtrace}"
message = "Error detaching virtual disk #{disk_id} from vm #{vmid}."\
" Reason: #{e.message}\n#{e.backtrace}"
STDERR.puts error_message(message)
exit -1
ensure
vi_client.close_connection if vi_client