From 53de3d04f96f035ee771053d7bdf6a150dd69f20 Mon Sep 17 00:00:00 2001 From: geemus Date: Fri, 13 May 2011 12:58:40 -0700 Subject: [PATCH] [core] handle busted ENV['HOME']. thanks pfalcone closes #301 --- lib/fog/core/credentials.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fog/core/credentials.rb b/lib/fog/core/credentials.rb index 2ce005d1d..ba0546781 100644 --- a/lib/fog/core/credentials.rb +++ b/lib/fog/core/credentials.rb @@ -19,7 +19,7 @@ module Fog # @return [String] The path for configuration_file def self.credentials_path @credential_path ||= begin - path = ENV["FOG_RC"] || (ENV['HOME'] && '~/.fog') + path = ENV["FOG_RC"] || (ENV['HOME'] && File.directory?(ENV['HOME']) && '~/.fog') File.expand_path(path) if path end end