diff --git a/lib/fog/local/models/storage/file.rb b/lib/fog/local/models/storage/file.rb index 992f7c78d..a57026762 100644 --- a/lib/fog/local/models/storage/file.rb +++ b/lib/fog/local/models/storage/file.rb @@ -50,7 +50,7 @@ module Fog break end pwd = Dir.pwd - if ::Dir.exists?(dir_path) + if ::File.exists?(dir_path) && ::File.directory?(dir_path) Dir.chdir(dir_path) if Dir.glob('*').empty? Dir.rmdir(dir_path)