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