1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

B #2318: Improve feedback for 'mode' option in Suntone server

This commit is contained in:
Abel Coronado 2018-07-25 12:19:23 +02:00 committed by Tino Vázquez
parent a8f5237d97
commit daf009b5b2
2 changed files with 14 additions and 1 deletions

View File

@ -32,11 +32,19 @@ class SunstoneViews
VIEWS_CONFIGURATION_DIR = ETC_LOCATION + "/sunstone-views/"
def initialize(mode)
raise "Sunstone configuration file does not contain default view mode, aborting" if mode.nil?
@views_config = YAML.load_file(VIEWS_CONFIGURATION_FILE)
base_path = SUNSTONE_ROOT_DIR+'/public/js/'
@views = Hash.new
raise "The #{mode} view directory does not exists, aborting" if Dir[VIEWS_CONFIGURATION_DIR + mode].empty?
raise "The #{mode} view directory is empty, aborting" if Dir[VIEWS_CONFIGURATION_DIR + mode + '/*.yaml'].empty?
Dir[VIEWS_CONFIGURATION_DIR + mode + '/*.yaml'].each do |p_path|
reg = VIEWS_CONFIGURATION_DIR + mode + '/'
m = p_path.match(/^#{reg}(.*).yaml$/)

View File

@ -183,7 +183,12 @@ end
set :cloud_auth, $cloud_auth
$views_config = SunstoneViews.new($conf[:mode])
begin
$views_config = SunstoneViews.new($conf[:mode])
rescue StandardError => e
logger.error { e.message }
exit -1
end
#start VNC proxy