mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-23 22:50:09 +03:00
feature #564: Made config a Sinatra option to fix scope.
This commit is contained in:
parent
22fe3392e8
commit
1dc7dbdab1
@ -225,7 +225,7 @@ class SunstoneServer
|
||||
vnc_port = resource['TEMPLATE/GRAPHICS/PORT']
|
||||
|
||||
# The noVNC proxy_port
|
||||
proxy_port = config[:vnc_proxy_base_port] + vnc_port.to_i
|
||||
proxy_port = config[:vnc_proxy_base_port].to_i + vnc_port.to_i
|
||||
|
||||
begin
|
||||
novnc_cmd = "#{config[:novnc_path]}/utils/launch.sh"
|
||||
|
@ -42,14 +42,14 @@ require 'sinatra'
|
||||
require 'cloud/Configuration'
|
||||
require 'SunstoneServer'
|
||||
|
||||
@config = Configuration.new(CONFIGURATION_FILE)
|
||||
set :config, Configuration.new(CONFIGURATION_FILE)
|
||||
|
||||
##############################################################################
|
||||
# Sinatra Configuration
|
||||
##############################################################################
|
||||
use Rack::Session::Pool
|
||||
set :host, @config[:host]
|
||||
set :port, @config[:port]
|
||||
set :host, settings.config[:host]
|
||||
set :port, settings.config[:port]
|
||||
|
||||
##############################################################################
|
||||
# Helpers
|
||||
@ -221,7 +221,7 @@ post '/vm/:id/startvnc' do
|
||||
return [200, info.to_json]
|
||||
end
|
||||
|
||||
rc = @SunstoneServer.startvnc(vm_id, @config)
|
||||
rc = @SunstoneServer.startvnc(vm_id, settings.config)
|
||||
if rc[0] == 200
|
||||
info = rc[1]
|
||||
session['vnc'][vm_id] = info.clone
|
||||
|
Loading…
x
Reference in New Issue
Block a user