mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-21 04:12:37 +09:00
appflow: Add sunstone-appflow.conf
This commit is contained in:
1 parent
4101962ceb
commit
075f672c7d
3 files changed
+20
-1
No files matched your search
@@ -98,6 +98,7 @@ copy_files "sunstone/routes/*" "$SUNSTONE_LOCATION/routes"
|
||||
|
||||
# Do not link the ETC files
|
||||
LINK="no"
|
||||
copy_files "sunstone/etc/sunstone-appflow.conf" "$ETC_LOCATION"
|
||||
copy_files "config/appflow-server.conf" "$ETC_LOCATION"
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
################################################################################
|
||||
# Appflow
|
||||
################################################################################
|
||||
|
||||
# Appflow endpoint
|
||||
#
|
||||
:appflow_server: http://localhost:2474/
|
||||
@@ -1,14 +1,25 @@
|
||||
APPFLOW_CONF_FILE = ETC_LOCATION + "/sunstone-appflow.conf"
|
||||
|
||||
$: << RUBY_LIB_LOCATION+"/apptools/flow"
|
||||
|
||||
require 'appflow_client'
|
||||
|
||||
begin
|
||||
appflow_conf = YAML.load_file(APPFLOW_CONF_FILE)
|
||||
rescue Exception => e
|
||||
STDERR.puts "Error parsing config file #{APPFLOW_CONF_FILE}: #{e.message}"
|
||||
exit 1
|
||||
end
|
||||
|
||||
set :appflow_config, appflow_conf
|
||||
|
||||
helpers do
|
||||
def build_client
|
||||
flow_client = settings.cloud_auth.client(session[:user])
|
||||
split_array = flow_client.one_auth.split(':')
|
||||
|
||||
Service::Client.new(
|
||||
:url => settings.config[:appflow_server],
|
||||
:url => settings.appflow_config[:appflow_server],
|
||||
:user_agent => "Sunstone",
|
||||
:username => split_array.shift,
|
||||
:password => split_array.join(':'))
|
||||
|
||||
Reference in new issue
Block a user