From 76d839e0f635704c515a400755cff9a094338c9c Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Mon, 26 Jul 2010 17:54:06 +0200 Subject: [PATCH] Changed the default trigger action for the image hook. Improved the image hook legibility --- share/etc/oned.conf | 2 +- share/hooks/image.rb | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/share/etc/oned.conf b/share/etc/oned.conf index 7834e187d4..efb3c70929 100644 --- a/share/etc/oned.conf +++ b/share/etc/oned.conf @@ -265,7 +265,7 @@ HM_MAD = [ VM_HOOK = [ name = "image", - on = "SHUTDOWN", + on = "DONE", command = "[HOOKS_LOCATION]/image.rb", arguments = "$VMID" ] diff --git a/share/hooks/image.rb b/share/hooks/image.rb index 22c92f6279..2d42ea53ca 100755 --- a/share/hooks/image.rb +++ b/share/hooks/image.rb @@ -47,12 +47,7 @@ vm.each('TEMPLATE/DISK') do |disk| disk_id = disk["DISK_ID"] source_path = VMDIR+"/#{vm_id}/disk.#{disk_id}" - image_id = nil - if disk["SAVE_AS"] - image_id = disk["SAVE_AS"] - end - - if image_id and source_path + if image_id = disk["SAVE_AS"] image=Image.new( Image.build_xml(image_id), client)