mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
parent
3999102c48
commit
9d6d16b425
1 changed files with 6 additions and 2 deletions
|
@ -31,8 +31,12 @@ module Fog
|
|||
# @raise [LoadError] Configuration unavailable in configuration file
|
||||
def self.credentials
|
||||
@credentials ||= begin
|
||||
credentials = YAML.load_file(credentials_path)
|
||||
(credentials && credentials[credential]) or raise LoadError.new missing_credentials
|
||||
if File.exists?(credentials_path)
|
||||
credentials = YAML.load_file(credentials_path)
|
||||
(credentials && credentials[credential]) or raise LoadError.new missing_credentials
|
||||
else
|
||||
{}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue