From d8aa8b7a4830ef2ef3f9f5fcf06791cdb27c9d52 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Mon, 28 Feb 2011 17:08:41 +0100 Subject: [PATCH] feature #495: Prepare ONE environment --- src/sunstone/models/OpenNebulaJSON.rb | 11 ----------- src/sunstone/models/SunstoneServer.rb | 5 +++++ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/sunstone/models/OpenNebulaJSON.rb b/src/sunstone/models/OpenNebulaJSON.rb index 709f553a48..9fb45fac7d 100644 --- a/src/sunstone/models/OpenNebulaJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON.rb @@ -14,17 +14,6 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -ONE_LOCATION = ENV["ONE_LOCATION"] if !ONE_LOCATION - -if !ONE_LOCATION - RUBY_LIB_LOCATION = "/usr/lib/one/ruby" -else - RUBY_LIB_LOCATION = ONE_LOCATION+"/lib/ruby" -end - -$: << RUBY_LIB_LOCATION -$: << File.dirname(__FILE__) - require 'OpenNebula' include OpenNebula diff --git a/src/sunstone/models/SunstoneServer.rb b/src/sunstone/models/SunstoneServer.rb index 007d8853dc..dd02e88264 100644 --- a/src/sunstone/models/SunstoneServer.rb +++ b/src/sunstone/models/SunstoneServer.rb @@ -19,11 +19,16 @@ ONE_LOCATION = ENV["ONE_LOCATION"] if !ONE_LOCATION LOG_LOCATION = "/var/log/one" VAR_LOCATION = "/var/lib/one" + RUBY_LIB_LOCATION = "/usr/lib/one/ruby" else VAR_LOCATION = ONE_LOCATION+"/var" LOG_LOCATION = ONE_LOCATION+"/var" + RUBY_LIB_LOCATION = ONE_LOCATION+"/lib/ruby" end +$: << RUBY_LIB_LOCATION +$: << File.dirname(__FILE__) + require 'models/OpenNebulaJSON' include OpenNebulaJSON