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:
parent
5cb1428bed
commit
1eec967a09
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue