1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-04-02 10:50:07 +03:00

Merge branch 'sunstone' of opennebula.org:one-ui into sunstone

This commit is contained in:
Jaime Melis 2011-02-22 19:08:12 +01:00
commit 399b700997

View File

@ -150,7 +150,11 @@ class SunstoneServer
############################################################################
#
############################################################################
def get_configuration
def get_configuration(user_id)
if user_id != "0"
return [401, ""]
end
one_config = VAR_LOCATION + "/config"
config = Hash.new
@ -178,17 +182,21 @@ class SunstoneServer
#
############################################################################
def get_vm_log(id)
id = id.to_s
vm_log_file = VAR_LOCATION + "/#{id}/vm.log"
resource = retrieve_resource("vm", id)
if OpenNebula.is_error?(resource)
return [404, nil]
else
vm_log_file = VAR_LOCATION + "/#{id}/vm.log"
begin
log = File.read(vm_log_file)
rescue Exception => e
error = Error.new("Error: log for VM #{id} not available")
return [500, error.to_s]
begin
log = File.read(vm_log_file)
rescue Exception => e
error = Error.new("Error: log for VM #{id} not available")
return [500, error.to_s]
end
return [200, log]
end
return [200, log]
end
private