Enable check for updates

This commit is contained in:
Jaime Melis committed 2016-06-10 10:46:35 +02:00
1 parent 8c12b6f404
commit 4de0cd3edf
2 files changed
+9 -6

No files matched your search

+1 -1
View File
@@ -99,7 +99,7 @@
# To check for the latest release. Comment this value if you don't want to check
# this.
# :remote_version: http://downloads.opennebula.org/latest
:remote_version: http://downloads.opennebula.org/latest
################################################################################
# UI Settings
+8 -5
View File
@@ -495,16 +495,19 @@ get '/spice' do
end
get '/version' do
version = {:version => OpenNebula::VERSION, :remote_version => nil}
version = {}
if (remote_version_url = $conf[:remote_version])
remote_version = Net::HTTP.get(URI(remote_version_url)).strip rescue nil
if !remote_version.nil? && !remote_version.empty?
version[:remote_version] = remote_version
begin
version = JSON.parse(Net::HTTP.get(URI(remote_version_url)))
rescue Exception
end
end
if !version[:version] || version[:version].empty?
version[:version] = OpenNebula::VERSION
end
[200, version.to_json]
end