From e15c4a377ea40568ca9c2330d22adc96c810549a Mon Sep 17 00:00:00 2001 From: Sjoerd Andringa Date: Sat, 2 Nov 2013 11:05:21 +0100 Subject: [PATCH] Also call #load in case of missing local root folder. --- lib/fog/local/models/storage/directories.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/fog/local/models/storage/directories.rb b/lib/fog/local/models/storage/directories.rb index 3ed4316c8..97b37e6bf 100644 --- a/lib/fog/local/models/storage/directories.rb +++ b/lib/fog/local/models/storage/directories.rb @@ -10,17 +10,16 @@ module Fog model Fog::Storage::Local::Directory def all - if ::File.directory?(service.local_root) - data = Dir.entries(service.local_root).select do |entry| + data = if ::File.directory?(service.local_root) + Dir.entries(service.local_root).select do |entry| entry[0...1] != '.' && ::File.directory?(service.path_to(entry)) end.map do |entry| {:key => entry} end - load(data) else - clear - self + [] end + load(data) end def get(key, options = {})