diff --git a/lib/fog/aws/models/s3/files.rb b/lib/fog/aws/models/s3/files.rb index b73eb0175..d4d9a8763 100644 --- a/lib/fog/aws/models/s3/files.rb +++ b/lib/fog/aws/models/s3/files.rb @@ -14,12 +14,12 @@ module Fog def all(options = {}) merge_attributes(options) - directory = directory.collection.get( + parent = directory.collection.get( directory.name, options ) - if directory - load(directory.files.map {|file| file.attributes}) + if parent + load(parent.files.map {|file| file.attributes}) else nil end diff --git a/lib/fog/rackspace/models/files/files.rb b/lib/fog/rackspace/models/files/files.rb index 375be0632..2bf770aa8 100644 --- a/lib/fog/rackspace/models/files/files.rb +++ b/lib/fog/rackspace/models/files/files.rb @@ -13,12 +13,12 @@ module Fog def all(options = {}) merge_attributes(options) - directory = directory.collection.get( + parent = directory.collection.get( directory.name, options ) - if directory - load(directory.files.map {|file| file.attributes}) + if parent + load(parent.files.map {|file| file.attributes}) else nil end