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
2016-05-07 00:27:04 +05:30
committed by Harshavardhana
parent 48d3be36da
commit 0b4bbe6d9e
5 changed files with 167 additions and 106 deletions

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 {