From e9bd6d50e6f8ae3d2cdfd6ae41626607fe9f9979 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Wed, 23 Feb 2011 18:00:58 +0100 Subject: [PATCH] Feature #495: Define VAR_LOCATION in SunstoneServer.rb for get_vm_log and get_configuration to work --- src/sunstone/models/SunstoneServer.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sunstone/models/SunstoneServer.rb b/src/sunstone/models/SunstoneServer.rb index d42a10fceb..fbb9422c82 100644 --- a/src/sunstone/models/SunstoneServer.rb +++ b/src/sunstone/models/SunstoneServer.rb @@ -16,6 +16,14 @@ # TBD Change path for intallation tree +ONE_LOCATION = ENV["ONE_LOCATION"] + +if !ONE_LOCATION + VAR_LOCATION = "/var/lib/one" +else + VAR_LOCATION = ONE_LOCATION+"/var" +end + #require 'OpenNebulaJSON' require 'models/OpenNebulaJSON' include OpenNebulaJSON @@ -154,7 +162,7 @@ class SunstoneServer if user_id != "0" return [401, ""] end - + one_config = VAR_LOCATION + "/config" config = Hash.new