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:
parent
10c94fbf40
commit
2a9da5782f
2 changed files with 7 additions and 1 deletions
|
@ -124,7 +124,7 @@ module Fog
|
||||||
end
|
end
|
||||||
|
|
||||||
def metadata_attributes
|
def metadata_attributes
|
||||||
if etag
|
if last_modified
|
||||||
headers = connection.head_object(directory.key, self.key).headers
|
headers = connection.head_object(directory.key, self.key).headers
|
||||||
headers.reject! {|k, v| !metadata_attribute?(k)}
|
headers.reject! {|k, v| !metadata_attribute?(k)}
|
||||||
else
|
else
|
||||||
|
|
|
@ -26,6 +26,12 @@ Shindo.tests('Fog::Rackspace::Storage | file', ['rackspace']) do
|
||||||
directories.
|
directories.
|
||||||
create(directory_attributes)
|
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
|
model_tests(@directory.files, file_attributes, Fog.mocking?) do
|
||||||
|
|
||||||
tests("#metadata should load empty metadata").returns({}) do
|
tests("#metadata should load empty metadata").returns({}) do
|
||||||
|
|
Loading…
Add table
Reference in a new issue