From 7d5bdda0c68e92f42ae626fbbbf3a8f6705115ea Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Mon, 6 May 2013 12:57:51 +0200 Subject: [PATCH] bug #1838: Check VNC states in sunstone server --- src/sunstone/OpenNebulaVNC.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sunstone/OpenNebulaVNC.rb b/src/sunstone/OpenNebulaVNC.rb index 981d610d99..cab450ea6c 100644 --- a/src/sunstone/OpenNebulaVNC.rb +++ b/src/sunstone/OpenNebulaVNC.rb @@ -142,8 +142,8 @@ class OpenNebulaVNC return error(400, "VNC Proxy is not running") end - if vm_resource['LCM_STATE'] != "3" - return error(400,"VM is not running") + if !VNC_STATES.include?(vm_resource['LCM_STATE']) + return error(400,"Wrong state (#{vm_resource['LCM_STATE']}) to open a VNC session") end if vm_resource['TEMPLATE/GRAPHICS/TYPE'].nil? ||