appflow: Add sunstone-appflow.conf

This commit is contained in:
Daniel Molina committed 2012-09-21 12:22:02 +02:00
1 parent 4101962ceb
commit 075f672c7d
3 files changed
+20 -1

No files matched your search

+1
View File
@@ -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"
+7
View File
@@ -0,0 +1,7 @@
################################################################################
# Appflow
################################################################################
# Appflow endpoint
#
:appflow_server: http://localhost:2474/
+12 -1
View File
@@ -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(':'))