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:
Harshavardhana
2016-04-05 11:24:23 -07:00
parent 083e4e9479
commit 9632c94e7a
5 changed files with 101 additions and 202 deletions
+6 -9
View File
@@ -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