Adding XL Object layer validation for existing unit tests of single node (#1499)

object layer.

Adding isBucketExist check for GetObjectInfo in the XL layer.
This commit is contained in:
karthic rao authored and Harshavardhana committed 2016-05-06 11:57:04 -07:00
1 parent 48d3be36da
commit 0b4bbe6d9e
5 files changed
+167 -106

No files matched your search

+6
View File
@@ -159,6 +159,12 @@ func (xl xlObjects) GetObjectInfo(bucket, object string) (ObjectInfo, error) {
if !IsValidObjectName(object) {
return ObjectInfo{}, ObjectNameInvalid{Bucket: bucket, Object: object}
}
// Check whether the bucket exists.
if isExist, err := isBucketExist(xl.storage, bucket); err != nil {
return ObjectInfo{}, err
} else if !isExist {
return ObjectInfo{}, BucketNotFound{Bucket: bucket}
}
fi, err := xl.storage.StatFile(bucket, object)
if err != nil {
if err != errFileNotFound {