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

fix credentials hinting for bin file

This commit is contained in:
Wesley Beary 2010-01-14 21:27:08 -08:00
parent 7519f5f823
commit 92924c7e26
2 changed files with 8 additions and 5 deletions

View file

@ -19,7 +19,7 @@ module Fog
YML
print(yml)
raise ArgumentError.new("No credentials for :#{key}")
exit
end
end
end

View file

@ -40,11 +40,14 @@ module Fog
def self.credentials(key = :default)
@credentials ||= begin
credentials = {}
File.open(File.expand_path('~/.fog')) do |file|
credentials = YAML.load(file.read)[key]
path = File.expand_path('~/.fog')
if File.exists?(path)
File.open(path) do |file|
YAML.load(file.read)[key]
end
else
nil
end
credentials
end
end