Class: Jellyfish::Fog::Azure::Validation

Inherits:
Object
  • Object
show all
Defined in:
lib/jellyfish_fog_azure/validation.rb

Instance Method Summary collapse

Instance Method Details

#validateObject

This function will return a true false value based off of whether the credentials provided in the .env file are valid



8
9
10
11
12
13
14
15
16
# File 'lib/jellyfish_fog_azure/validation.rb', line 8

def validate
  server_list = Connection.new.connect.servers.all
  # Can return nil if no servers are present.
  # Will return an error if the connection is incorrect
  # Ensuring it is a valid test
  server_list.is_a?(Array) || server_list.nil? ? true : false
  rescue StandardError
    false
end