mirror of
https://github.com/pgsty/minio.git
synced 2026-08-08 23:33:30 +03:00
Fix list objects test and remove all the old unnecessary files.
- Fix tests for new changes. - Change Golang err as 'e' for the time being, before we bring in probe removal change. - Remove old structs and temporary files.
This commit is contained in:
@@ -32,15 +32,13 @@ const (
|
||||
|
||||
// isDirExist - returns whether given directory is exist or not.
|
||||
func isDirExist(dirname string) (bool, error) {
|
||||
fi, err := os.Lstat(dirname)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
fi, e := os.Lstat(dirname)
|
||||
if e != nil {
|
||||
if os.IsNotExist(e) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
return false, err
|
||||
return false, e
|
||||
}
|
||||
|
||||
return fi.IsDir(), nil
|
||||
}
|
||||
|
||||
@@ -129,9 +127,8 @@ func (fs Filesystem) ListObjects(bucket, prefix, marker, delimiter string, maxKe
|
||||
// Verify if prefix exists.
|
||||
prefixDir := filepath.Dir(filepath.FromSlash(prefix))
|
||||
rootDir := filepath.Join(bucketDir, prefixDir)
|
||||
_, e := isDirExist(rootDir)
|
||||
if e != nil {
|
||||
if os.IsNotExist(e) {
|
||||
if status, e := isDirExist(rootDir); !status {
|
||||
if e == nil {
|
||||
// Prefix does not exist, not an error just respond empty
|
||||
// list response.
|
||||
return result, nil
|
||||
|
||||
Reference in New Issue
Block a user