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

Bug #2525: Checks that it cannot connect with OpenNebula

This commit is contained in:
Jaime Melis 2014-04-10 12:28:35 +02:00
parent 52316e726b
commit e63850a4b0
2 changed files with 9 additions and 0 deletions

View File

@ -37,6 +37,7 @@ $: << RUBY_LIB_LOCATION+'/onedb'
require 'cli/command_parser'
require 'onedb'
require 'opennebula'
FORCE={
:name => "force",

View File

@ -133,6 +133,8 @@ class OneDB
# max_version is ignored for now, as this is the first onedb release.
# May be used in next releases
def upgrade(max_version, ops)
one_not_running()
db_version = @backend.read_db_version
if ops[:verbose]
@ -437,6 +439,12 @@ is preserved.
if File.exists?(LOCK_FILE)
raise "First stop OpenNebula. Lock file found: #{LOCK_FILE}"
end
client = OpenNebula::Client.new
rc = client.get_version
if !OpenNebula.is_error?(rc)
raise "OpenNebula found listening on '#{client.one_endpoint}'"
end
end
def pretty_print_db_version(db_version)