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

This commit is contained in:
Abel Coronado authored and Tino Vázquez committed 2018-07-25 17:17:23 +02:00
1 parent a8f5237d97
commit daf009b5b2
2 files changed
+14 -1

No files matched your search

+8
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$/)
+6 -1
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