Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove fmt.Print statement from decomposedfs #1988

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-spaces-print-log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Remove fmt.Print statement from decomposedfs

The logs have been spammed with messages like `could not create symlink for ...` when using the decomposedfs, eg. with the oCIS storage.

https://github.com/cs3org/reva/pull/1988
9 changes: 4 additions & 5 deletions pkg/storage/utils/decomposedfs/decomposedfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ package decomposedfs

import (
"context"
"fmt"
"io"
"math"
"net/url"
Expand Down Expand Up @@ -232,10 +231,10 @@ func (fs *Decomposedfs) createStorageSpace(spaceType, nodeID string) error {
}

// we can reuse the node id as the space id
err := os.Symlink("../../nodes/"+nodeID, filepath.Join(fs.o.Root, "spaces", spaceType, nodeID))
if err != nil {
fmt.Printf("could not create symlink for '%s' space %s, %s\n", spaceType, nodeID, err)
}
_ = os.Symlink("../../nodes/"+nodeID, filepath.Join(fs.o.Root, "spaces", spaceType, nodeID))
//if err != nil {
// fmt.Printf("could not create symlink for '%s' space %s, %s\n", spaceType, nodeID, err)
//}

return nil
}
Expand Down
16 changes: 8 additions & 8 deletions pkg/storage/utils/decomposedfs/tree/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,18 @@ func (t *Tree) Setup(owner string) error {
if isRootNode(nodePath) {
// create personal space
// we can reuse the node id as the space id
err = os.Symlink("../../nodes/"+nodes[i].Name(), filepath.Join(t.root, "spaces/personal", nodes[i].Name()))
if err != nil {
fmt.Printf("could not create symlink for personal space %s, %s\n", nodes[i].Name(), err)
}
_ = os.Symlink("../../nodes/"+nodes[i].Name(), filepath.Join(t.root, "spaces/personal", nodes[i].Name()))
//if err != nil {
// fmt.Printf("could not create symlink for personal space %s, %s\n", nodes[i].Name(), err)
//}
}

// is it a shared node? -> create shared space
if isSharedNode(nodePath) {
err = os.Symlink("../../nodes/"+nodes[i].Name(), filepath.Join(t.root, "spaces/share", nodes[i].Name()))
if err != nil {
fmt.Printf("could not create symlink for shared space %s, %s\n", nodes[i].Name(), err)
}
_ = os.Symlink("../../nodes/"+nodes[i].Name(), filepath.Join(t.root, "spaces/share", nodes[i].Name()))
//if err != nil {
// fmt.Printf("could not create symlink for shared space %s, %s\n", nodes[i].Name(), err)
//}
}
}
} else if !fi.IsDir() {
Expand Down