Browse Source

fix test_bucket_listv2_delimiter_basic

pull/5580/head
Konstantin Lebedev 8 months ago
parent
commit
7df646b4e1
  1. 2
      weed/filer/filer.go
  2. 7
      weed/server/filer_server_handlers_write_autochunk.go

2
weed/filer/filer.go

@ -304,7 +304,7 @@ func (f *Filer) ensureParentDirectoryEntry(ctx context.Context, entry *Entry, di
} else if !dirEntry.IsDirectory() { } else if !dirEntry.IsDirectory() {
glog.Errorf("CreateEntry %s: dir entry %+v should be a directory", entry.FullPath, dirEntry) glog.Errorf("CreateEntry %s: dir entry %+v should be a directory", entry.FullPath, dirEntry)
//return fmt.Errorf("%s is a file", dirPath)
return fmt.Errorf("%s is a file", dirPath)
} }
return nil return nil

7
weed/server/filer_server_handlers_write_autochunk.go

@ -266,7 +266,12 @@ func (fs *FilerServer) saveMetaData(ctx context.Context, r *http.Request, fileNa
} }
} }
if dbErr := fs.filer.CreateEntry(ctx, entry, false, false, nil, skipCheckParentDirEntry(r), so.MaxFileNameLength); dbErr != nil {
dbErr := fs.filer.CreateEntry(ctx, entry, false, false, nil, skipCheckParentDirEntry(r), so.MaxFileNameLength)
// In test_bucket_listv2_delimiter_basic, the valid object key is the parent folder
if dbErr != nil && strings.HasSuffix(dbErr.Error(), " is a file") && r.Header.Get(s3_constants.AmzIdentityId) != "" {
dbErr = fs.filer.CreateEntry(ctx, entry, false, false, nil, true, so.MaxFileNameLength)
}
if dbErr != nil {
replyerr = dbErr replyerr = dbErr
filerResult.Error = dbErr.Error() filerResult.Error = dbErr.Error()
glog.V(0).Infof("failing to write %s to filer server : %v", path, dbErr) glog.V(0).Infof("failing to write %s to filer server : %v", path, dbErr)

Loading…
Cancel
Save