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

fixed bug where Fog::Storage::Rackspace::File raised Fog::Storage::Rackspace::NotFound if file was created with passed etag attribute. Changed to check existence based on last_modified instead of etag.

This commit is contained in:
Evan Smith 2012-12-17 10:08:19 -08:00
parent 10c94fbf40
commit 2a9da5782f
2 changed files with 7 additions and 1 deletions

View file

@ -124,7 +124,7 @@ module Fog
end
def metadata_attributes
if etag
if last_modified
headers = connection.head_object(directory.key, self.key).headers
headers.reject! {|k, v| !metadata_attribute?(k)}
else

View file

@ -26,6 +26,12 @@ Shindo.tests('Fog::Rackspace::Storage | file', ['rackspace']) do
directories.
create(directory_attributes)
model_tests(@directory.files, file_attributes.merge(:etag => 'foo'), Fog.mocking?) do
tests('#save should not blow up with etag') do
@instance.save
end
end
model_tests(@directory.files, file_attributes, Fog.mocking?) do
tests("#metadata should load empty metadata").returns({}) do