Donut cleanup another set

- Make sure to close all readers
- Fix errors in api_testsuite c.Assert(err, IsNil) should be done right after each function call
This commit is contained in:
Harshavardhana
2015-06-25 18:52:07 -07:00
parent eec66f195a
commit fb9adb5524
4 changed files with 29 additions and 14 deletions

View File

@@ -192,7 +192,7 @@ func (dt donut) PutObject(bucket, object, expectedMD5Sum string, reader io.ReadC
if _, ok := dt.buckets[bucket]; !ok {
return "", iodine.New(BucketNotFound{Bucket: bucket}, nil)
}
objectList, _, _, err := dt.buckets[bucket].ListObjects(object, "", "", 1)
objectList, _, _, err := dt.buckets[bucket].ListObjects("", "", "", 1000)
if err != nil {
return "", iodine.New(err, nil)
}
@@ -245,7 +245,12 @@ func (dt donut) GetObjectMetadata(bucket, object string) (map[string]string, err
if _, ok := dt.buckets[bucket]; !ok {
return nil, iodine.New(BucketNotFound{Bucket: bucket}, errParams)
}
objectList, _, _, err := dt.buckets[bucket].ListObjects(object, "", "", 1)
//
// there is a potential issue here, if the object comes after the truncated list
// below GetObjectMetadata would fail as ObjectNotFound{}
//
// will fix it when we bring in persistent json into Donut - TODO
objectList, _, _, err := dt.buckets[bucket].ListObjects("", "", "", 1000)
if err != nil {
return nil, iodine.New(err, errParams)
}