1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[core] fix exceptions from nil credential value

This commit is contained in:
Blake Gentry 2011-11-16 15:08:32 -08:00
parent 5cb1428bed
commit 1eec967a09

View file

@ -5,15 +5,15 @@ module Fog
# Assign a new credential to use from configuration file
# @param [String, Symbol] new_credential name of new credential to use
# @ return [String, Symbol] name of the new credential
# @ return [Symbol] name of the new credential
def self.credential=(new_credential)
@credentials = nil
@credential = new_credential.to_sym
@credential = new_credential && new_credential.to_sym
end
# @return [String, Symbol] The credential to use in Fog
def self.credential
@credential ||= ENV["FOG_CREDENTIAL"].to_sym || :default
@credential ||= ( ENV["FOG_CREDENTIAL"] && ENV["FOG_CREDENTIAL"].to_sym ) || :default
end
# @return [String] The path for configuration_file