From d40810396da97c47f65edce0f676450fb753f1d8 Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Tue, 20 Nov 2012 15:24:47 +0100 Subject: [PATCH] Fix bug in host_on_error hook (cherry picked from commit 406d4e89f6b8fe3ed7058cad9fca0db6845987d4) --- share/hooks/host_error.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/hooks/host_error.rb b/share/hooks/host_error.rb index 559f2b31a8..a7eab104de 100755 --- a/share/hooks/host_error.rb +++ b/share/hooks/host_error.rb @@ -87,8 +87,8 @@ end # Retrieve hostname host = OpenNebula::Host.new_with_id(host_id, client) -exit -1 if OpenNebula.is_error?(host) -host.info +rc = host.info +exit -1 if OpenNebula.is_error?(rc) host_name = host.name if repeat @@ -106,9 +106,9 @@ end # Loop through all vms vms = VirtualMachinePool.new(client) -exit -1 if OpenNebula.is_error?(vms) +rc = vms.info_all +exit -1 if OpenNebula.is_error?(rc) -vms.info_all state = "STATE=3" state += " or STATE=5" if force == "y"