Skip to content

Commit

Permalink
remove print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
labkode authored and glpatcern committed Oct 30, 2024
1 parent 6aa0184 commit 154d321
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 19 deletions.
9 changes: 0 additions & 9 deletions pkg/storage/fs/cephfs/cephfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,27 +225,20 @@ func (fs *cephfs) ListFolder(ctx context.Context, ref *provider.Reference, mdKey

log := appctx.GetLogger(ctx)
log.Debug().Interface("ref", ref)
fmt.Println("debugging: listing folder", ref)
user := fs.makeUser(ctx)
fmt.Println("debugging: user", user)

fmt.Println("debugging: ceph got", ref)
var path string
if path, err = user.resolveRef(ref); err != nil {
return nil, err
}
fmt.Println("debugging: listing folder after user resolv ref", path)

user.op(func(cv *cacheVal) {
var dir *goceph.Directory
if dir, err = cv.mount.OpenDir(path); err != nil {
fmt.Println(err)
return
}
defer closeDir(dir)

fmt.Println("debugging: dir obtained ", dir)

var entry *goceph.DirEntryPlus
var ri *provider.ResourceInfo

Expand All @@ -254,9 +247,7 @@ func (fs *cephfs) ListFolder(ctx context.Context, ref *provider.Reference, mdKey
continue
}

fmt.Println("debugging: inside ReadDirPlus, before user.fileAsResourceInfo", cv, filepath.Join(path, entry.Name()), entry.Statx(), mdKeys)
ri, err = user.fileAsResourceInfo(cv, filepath.Join(path, entry.Name()), entry.Statx(), mdKeys)
fmt.Println("debugging: inside ReadDirPlus, after user.fileAsResourceInfo", cv, filepath.Join(path, entry.Name()), entry.Statx(), mdKeys)
if ri == nil || err != nil {
if err != nil {
log := appctx.GetLogger(ctx)
Expand Down
3 changes: 0 additions & 3 deletions pkg/storage/fs/cephfs/chunking.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ type ChunkHandler struct {

// NewChunkHandler creates a handler for chunked uploads.
func NewChunkHandler(ctx context.Context, fs *cephfs) *ChunkHandler {
fmt.Println("debugging NewChunkHandler", fs.makeUser(ctx), fs.conf.UploadFolder)
u := fs.makeUser(ctx)
return &ChunkHandler{u, path.Join(u.home, fs.conf.UploadFolder)}
}
Expand Down Expand Up @@ -125,7 +124,6 @@ func (c *ChunkHandler) saveChunk(path string, r io.ReadCloser) (finish bool, chu
// err = fmt.Errorf("error getting transfer folder anme", err)
return
}
fmt.Println("debugging: transferfoldername", transferFolderName)

// here we write a temporary file that will be renamed to the transfer folder
// with the correct sequence number filename.
Expand All @@ -135,7 +133,6 @@ func (c *ChunkHandler) saveChunk(path string, r io.ReadCloser) (finish bool, chu
c.user.op(func(cv *cacheVal) {
var tmpFile *goceph.File
target := filepath.Join(c.uploadFolder, tmpFilename)
fmt.Println("debugging savechunk, target: ", target)
tmpFile, err = cv.mount.Open(target, os.O_CREATE|os.O_WRONLY, c.user.fs.conf.FilePerms)
defer closeFile(tmpFile)
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions pkg/storage/fs/cephfs/connections.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ func newAdminConn(conf *Options) (*adminConn, error) {
}

func newConn(user *User) *cacheVal {
fmt.Printf("debugging user: %+v\n", user)
var perm *goceph.UserPerm
mount, err := goceph.CreateMountWithId(user.fs.conf.ClientID)
if err != nil {
Expand All @@ -204,7 +203,6 @@ func newConn(user *User) *cacheVal {
}

if user != nil { //nil creates admin conn
fmt.Println("creating admin connection: debugging new connection for user: ", user.UidNumber)
perm = goceph.NewUserPerm(int(user.UidNumber), int(user.GidNumber), []int{})
if err = mount.SetMountPerms(perm); err != nil {
return destroyCephConn(mount, perm)
Expand Down
4 changes: 0 additions & 4 deletions pkg/storage/fs/cephfs/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ package cephfs

import (
"context"
"fmt"
"io"
"os"

Expand All @@ -44,7 +43,6 @@ func (fs *cephfs) Upload(ctx context.Context, ref *provider.Reference, r io.Read
}

if !ok {
fmt.Println("debugging: upload is not chunked", p)
var file io.WriteCloser
user.op(func(cv *cacheVal) {
file, err = cv.mount.Open(p, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, fs.conf.FilePerms)
Expand All @@ -65,13 +63,11 @@ func (fs *cephfs) Upload(ctx context.Context, ref *provider.Reference, r io.Read
}

// upload is chunked
fmt.Println("debugging: upload is chunked", p)

var assembledFile string

// iniate the chunk handler
originalFilename, assembledFile, err := NewChunkHandler(ctx, fs).WriteChunk(p, r)
fmt.Println("debugging: assembly file", originalFilename, assembledFile, r)
if err != nil {
return errors.Wrapf(err, "error writing chunk %v %v %v", p, r, assembledFile)
}
Expand Down
1 change: 0 additions & 1 deletion pkg/storage/fs/cephfs/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func (fs *cephfs) makeUser(ctx context.Context) *User {
u := appctx.ContextMustGetUser(ctx)
// home := fs.conf.Root
home := filepath.Join(fs.conf.Root, templates.WithUser(u, fs.conf.UserLayout))
fmt.Println("debugging makeUser", home)
return &User{u, fs, ctx, home}
}

Expand Down

0 comments on commit 154d321

Please sign in to comment.