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

Refactor OpenNebula version for CLI and CloudClient

This commit is contained in:
Jaime Melis 2012-07-03 19:05:22 +02:00
parent b3c31e0332
commit 3d26a1b38e
4 changed files with 16 additions and 8 deletions

View File

@ -21,7 +21,7 @@ include OpenNebula
module OpenNebulaHelper
ONE_VERSION=<<-EOT
OpenNebula 3.5.80
OpenNebula #{OpenNebula::VERSION}
Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org)
Licensed under the Apache License, Version 2.0 (the "License"); you may

View File

@ -48,6 +48,10 @@ end
# Cloud Client
###############################################################################
module CloudClient
# OpenNebula version
VERSION = '3.5.80'
# #########################################################################
# Default location for the authentication file
# #########################################################################
@ -152,7 +156,7 @@ module CloudCLI
begin
doc = REXML::Document.new(xml_text)
rescue REXML::ParseException => e
return e.message, -1
return e.message, -1
end
xml = doc.root
@ -170,18 +174,18 @@ module CloudCLI
else
str = xml.to_s
end
return str, 0
end
# Returns the command name
def cmd_name
File.basename($0)
end
def version_text
version=<<EOT
OpenNebula 3.5.80
OpenNebula #{CloudClient::VERSION}
Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org)
Licensed under the Apache License, Version 2.0 (the "License"); you may

View File

@ -26,7 +26,8 @@ module Market
url ||= 'http://localhost:9292/'
@uri = URI.parse(url)
@user_agent = "OpenNebula 3.5.80 (#{user_agent})"
@user_agent = "OpenNebula #{CloudClient::VERSION} (#{user_agent})"
pp @user_agent
end
def get(path)
@ -77,4 +78,4 @@ module Market
get("/appliance/#{id}")
end
end
end
end

View File

@ -49,6 +49,9 @@ require 'OpenNebula/ClusterPool'
module OpenNebula
# OpenNebula version
VERSION = '3.5.80'
# The Error Class represents a generic error in the OpenNebula
# library. It contains a readable representation of the error.
# Any function in the OpenNebula module will return an Error