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

Enable check for updates

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

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

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