lib/one2influx/config.rb
# Checks it is possible to connect to ONE with provided credentials.
Checks it is possible to connect to ONE with provided credentials.
Checks it is possible to connect to ONE with provided credentials .
def is_one_available?
    begin
      client = OpenNebula::Client.new(@@one[:credentials], @@one[:endpoint])
    rescue Exception => e
      $LOG.error "Unable to connect to ONE with message: #{e.message}"
      return false
    end
    version = client.get_version
    if version.is_a? OpenNebula::Error
      $LOG.error 'Unable to find out ONE version with message: '+version.message
      return false
    end
    $LOG.info 'Connection with ONE verified.'
    return true
  end
def is_one_available? begin client = OpenNebula :: Client . new ( @@one [ :credentials ] , @@one [ :endpoint ] ) rescue Exception => e $LOG . error "Unable to connect to ONE with message: #{e.message}" return false end version = client . get_version if version . is_a? OpenNebula :: Error $LOG . error 'Unable to find out ONE version with message: ' + version . message return false end $LOG . info 'Connection with ONE verified.' return true end
Checks it is possible to connect to ONE with provided credentials.
Checks it is possible to connect to ONE with provided credentials .
# Try to get ONE version just to check if it's possible to connect to ONE