Bug #757: Fix: start vnc proxy setup

Fixed the access to the Hostname in which the VM is deployed. Improved proxy start by calling direcly the proxy script and not the launch.sh wrapper script.
This commit is contained in:
Hector Sanjuan authored and Ruben S. Montero committed 2011-07-31 17:12:42 +02:00
1 parent e55540f0c3
commit dfd490182c
1 file changed
+3 -4
+3 -4
View File
@@ -246,15 +246,14 @@ class SunstoneServer
end
# The VM host and its VNC port
host = resource['HISTORY/HOSTNAME']
host = resource['/VM/HISTORY_RECORDS/HISTORY[last()]/HOSTNAME']
vnc_port = resource['TEMPLATE/GRAPHICS/PORT']
# The noVNC proxy_port
proxy_port = config[:vnc_proxy_base_port].to_i + vnc_port.to_i
begin
novnc_cmd = "#{config[:novnc_path]}/utils/launch.sh"
pipe = IO.popen("#{novnc_cmd} --listen #{proxy_port} \
--vnc #{host}:#{vnc_port}")
novnc_cmd = "#{config[:novnc_path]}/utils/wsproxy.py"
pipe = IO.popen("#{novnc_cmd} #{proxy_port} #{host}:#{vnc_port}")
rescue Exception => e
error = Error.new(e.message)
return [500, error.to_json]