From 330bfa1eb2bd654887a0e9cf5008b08a27eb794e Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Mon, 15 Jul 2013 19:35:16 +0200 Subject: [PATCH] get rid of sunstone-oneflow.conf --- install.sh | 3 +-- src/sunstone/etc/sunstone-oneflow.conf | 23 ----------------------- src/sunstone/etc/sunstone-server.conf | 10 +++++++++- src/sunstone/routes/oneflow.rb | 14 ++------------ 4 files changed, 12 insertions(+), 38 deletions(-) delete mode 100644 src/sunstone/etc/sunstone-oneflow.conf diff --git a/install.sh b/install.sh index 0c12de176e..fef90afa31 100755 --- a/install.sh +++ b/install.sh @@ -1472,8 +1472,7 @@ SUNSTONE_BIN_FILES="src/sunstone/bin/sunstone-server \ src/sunstone/bin/novnc-server" SUNSTONE_ETC_FILES="src/sunstone/etc/sunstone-server.conf \ - src/sunstone/etc/sunstone-views.yaml \ - src/sunstone/etc/sunstone-oneflow.conf" + src/sunstone/etc/sunstone-views.yaml" SUNSTONE_ETC_VIEW_FILES="src/sunstone/etc/sunstone-views/admin.yaml \ src/sunstone/etc/sunstone-views/user.yaml \ diff --git a/src/sunstone/etc/sunstone-oneflow.conf b/src/sunstone/etc/sunstone-oneflow.conf deleted file mode 100644 index 9898b67015..0000000000 --- a/src/sunstone/etc/sunstone-oneflow.conf +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------- # -# Copyright 2010-2013, C12G Labs S.L. # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); you may # -# not use this file except in compliance with the License. You may obtain # -# a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -#--------------------------------------------------------------------------- # - -################################################################################ -# OneFlow -################################################################################ - -# OneFlow endpoint -# -:oneflow_server: http://localhost:2474/ \ No newline at end of file diff --git a/src/sunstone/etc/sunstone-server.conf b/src/sunstone/etc/sunstone-server.conf index a0d3b00289..853bdf817b 100644 --- a/src/sunstone/etc/sunstone-server.conf +++ b/src/sunstone/etc/sunstone-server.conf @@ -104,6 +104,14 @@ # :marketplace_url: http://marketplace.c12g.com/appliance +################################################################################ +# OneFlow +################################################################################ + +# OneFlow endpoint +# +:oneflow_server: http://localhost:2474/ + ################################################################################ # Routes ################################################################################ @@ -126,4 +134,4 @@ # - other :routes: - - oneflow \ No newline at end of file + - oneflow diff --git a/src/sunstone/routes/oneflow.rb b/src/sunstone/routes/oneflow.rb index 4e4975e0b8..7c61adb353 100644 --- a/src/sunstone/routes/oneflow.rb +++ b/src/sunstone/routes/oneflow.rb @@ -14,28 +14,18 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -ONEFLOW_CONF_FILE = ETC_LOCATION + "/sunstone-oneflow.conf" - $: << RUBY_LIB_LOCATION+"/oneflow" require 'opennebula/oneflow_client' -begin - oneflow_conf = YAML.load_file(ONEFLOW_CONF_FILE) -rescue Exception => e - STDERR.puts "Error parsing config file #{ONEFLOW_CONF_FILE}: #{e.message}" - exit 1 -end - -set :oneflow_config, oneflow_conf helpers do def af_build_client - flow_client = settings.cloud_auth.client(session[:user]) + flow_client = $cloud_auth.client(session[:user]) split_array = flow_client.one_auth.split(':') Service::Client.new( - :url => settings.oneflow_config[:oneflow_server], + :url => $conf[:oneflow_server], :user_agent => "Sunstone", :username => split_array.shift, :password => split_array.join(':'))