From 7ab03f0ecbd501e12056e19c45328a1e11b85778 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Wed, 26 Oct 2011 23:47:05 +0200 Subject: [PATCH] bug #847: Udate EC2_AUTH and OCCI_AUTH location --- src/cloud/ec2/lib/econe-server.rb | 13 +++++++------ src/cloud/occi/lib/occi-server.rb | 12 +++++++----- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/cloud/ec2/lib/econe-server.rb b/src/cloud/ec2/lib/econe-server.rb index c115bad093..b500d9975c 100644 --- a/src/cloud/ec2/lib/econe-server.rb +++ b/src/cloud/ec2/lib/econe-server.rb @@ -21,17 +21,18 @@ ONE_LOCATION=ENV["ONE_LOCATION"] if !ONE_LOCATION RUBY_LIB_LOCATION = "/usr/lib/one/ruby" + VAR_LOCATION = "/var/lib/one" CONFIGURATION_FILE = "/etc/one/econe.conf" TEMPLATE_LOCATION = "/etc/one/ec2query_templates" - EC2_AUTH = "/etc/one/auth/ec2_auth" else RUBY_LIB_LOCATION = ONE_LOCATION+"/lib/ruby" + VAR_LOCATION = ONE_LOCATION+"/var" CONFIGURATION_FILE = ONE_LOCATION+"/etc/econe.conf" TEMPLATE_LOCATION = ONE_LOCATION+"/etc/ec2query_templates" - EC2_AUTH = ONE_LOCATION + "/etc/auth/ec2_auth" end VIEWS_LOCATION = RUBY_LIB_LOCATION + "/cloud/econe/views" +EC2_AUTH = VAR_LOCATION + "/ec2_auth" $: << RUBY_LIB_LOCATION $: << RUBY_LIB_LOCATION+"/cloud" @@ -76,13 +77,13 @@ if CloudServer.is_port_open?(settings.config[:server], puts "Port busy, please shutdown the service or move econe server port." exit 1 end - -begin + +begin ENV["ONE_CIPHER_AUTH"] = EC2_AUTH cloud_auth = CloudAuth.new(settings.config) rescue => e puts "Error initializing authentication system" - puts e.message + puts e.message exit -1 end @@ -91,7 +92,7 @@ set :cloud_auth, cloud_auth econe_host = conf[:ssl_server] econe_host ||= conf[:server] econe_port = conf[:port] - + set :econe_host, econe_host set :econe_port, econe_port diff --git a/src/cloud/occi/lib/occi-server.rb b/src/cloud/occi/lib/occi-server.rb index 36545793e9..ee8abec39c 100755 --- a/src/cloud/occi/lib/occi-server.rb +++ b/src/cloud/occi/lib/occi-server.rb @@ -26,16 +26,18 @@ ONE_LOCATION=ENV["ONE_LOCATION"] if !ONE_LOCATION RUBY_LIB_LOCATION="/usr/lib/one/ruby" + VAR_LOCATION = "/var/lib/one" TEMPLATE_LOCATION="/etc/one/occi_templates" CONFIGURATION_FILE = "/etc/one/occi-server.conf" - OCCI_AUTH = "/etc/one/auth/occi_auth" else RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" + VAR_LOCATION = ONE_LOCATION+"/var" TEMPLATE_LOCATION=ONE_LOCATION+"/etc/occi_templates" CONFIGURATION_FILE = ONE_LOCATION+"/etc/occi-server.conf" - OCCI_AUTH = ONE_LOCATION + "/etc/auth/occi_auth" end +OCCI_AUTH = VAR_LOCATION + "/occi_auth" + $: << RUBY_LIB_LOCATION $: << RUBY_LIB_LOCATION+"/cloud/occi" $: << RUBY_LIB_LOCATION+"/cloud" # For the Repository Manager @@ -80,15 +82,15 @@ end set :host, settings.config[:server] set :port, settings.config[:port] -begin +begin ENV["ONE_CIPHER_AUTH"] = OCCI_AUTH cloud_auth = CloudAuth.new(settings.config) rescue => e puts "Error initializing authentication system" - puts e.message + puts e.message exit -1 end - + set :cloud_auth, cloud_auth ##############################################################################