Skip to content

Commit

Permalink
remove more 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 154d321 commit 6b0f9b3
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 17 deletions.
3 changes: 0 additions & 3 deletions internal/grpc/services/gateway/storageprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package gateway

import (
"context"
"fmt"
"net/url"
"path"
"strings"
Expand Down Expand Up @@ -221,8 +220,6 @@ func (s *svc) initiateFileUpload(ctx context.Context, req *provider.InitiateFile
}, nil
}

fmt.Println("debugging initiatefileupload response", storageRes)

protocols := make([]*gateway.FileUploadProtocol, len(storageRes.Protocols))
for p := range storageRes.Protocols {
protocols[p] = &gateway.FileUploadProtocol{
Expand Down
4 changes: 0 additions & 4 deletions internal/grpc/services/storageprovider/storageprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,6 @@ func (s *service) ListContainerStream(req *provider.ListContainerStreamRequest,

func (s *service) ListContainer(ctx context.Context, req *provider.ListContainerRequest) (*provider.ListContainerResponse, error) {
newRef, err := s.unwrap(ctx, req.Ref)
fmt.Println("debugging: storageprovider: ", req, newRef)
mds, err := s.storage.ListFolder(ctx, newRef, req.ArbitraryMetadataKeys)
if err != nil {
var st *rpc.Status
Expand Down Expand Up @@ -1538,17 +1537,14 @@ func (s *service) unwrap(ctx context.Context, ref *provider.Reference) (*provide
// TODO move mount path trimming to the gateway
fn, err := s.trimMountPrefix(ref.GetPath())
if err != nil {
fmt.Println("debugging: problem found", fn, err)
return nil, err
}
return &provider.Reference{Path: fn}, nil
}

func (s *service) trimMountPrefix(fn string) (string, error) {
fmt.Println("debugging trimMountPrefix", fn, s.mountPath, len(fn), len(s.mountPath))
if strings.HasPrefix(fn, s.mountPath) {
p := path.Join("/", strings.TrimPrefix(fn, s.mountPath))
fmt.Println("debugging we are here", p)
return p, nil
}
return "", errtypes.BadRequest(fmt.Sprintf("path=%q does not belong to this storage provider mount path=%q", fn, s.mountPath))
Expand Down
2 changes: 0 additions & 2 deletions internal/http/services/datagateway/datagateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package datagateway
import (
"context"
"crypto/tls"
"fmt"
"io"
"net/http"
"net/url"
Expand Down Expand Up @@ -323,7 +322,6 @@ func (s *svc) doPut(w http.ResponseWriter, r *http.Request) {
return
}
httpReq.Header = r.Header
fmt.Println("debugging PUT", httpReq, claims, target)
httpRes, err := httpClient.Do(httpReq)
if err != nil {
log.Err(err).Msg("error doing PUT request to data service")
Expand Down
6 changes: 0 additions & 6 deletions internal/http/services/owncloud/ocdav/propfind.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ const (
func (s *svc) handlePathPropfind(w http.ResponseWriter, r *http.Request, ns string) {
ctx := r.Context()
fn := path.Join(ns, r.URL.Path)
fmt.Println("debugging fn", fn)

sublog := appctx.GetLogger(ctx).With().Str("path", fn).Logger()

Expand All @@ -82,7 +81,6 @@ func (s *svc) handlePathPropfind(w http.ResponseWriter, r *http.Request, ns stri
}

ref := &provider.Reference{Path: fn}
fmt.Println("debugging reference inside webdav", fn)

parentInfo, resourceInfos, ok := s.getResourceInfos(ctx, w, r, pf, ref, false, sublog)
if !ok {
Expand Down Expand Up @@ -263,7 +261,6 @@ func (s *svc) getResourceInfos(ctx context.Context, w http.ResponseWriter, r *ht
ArbitraryMetadataKeys: metadataKeys,
}

fmt.Println("debugging request for", req)
res, err := client.Stat(ctx, req)
if err != nil {
log.Error().Err(err).Interface("req", req).Msg("error sending a grpc stat request")
Expand All @@ -283,7 +280,6 @@ func (s *svc) getResourceInfos(ctx context.Context, w http.ResponseWriter, r *ht
HandleErrorStatus(&log, w, res.Status)
return nil, nil, false
}
fmt.Println("debugging after client.stat", res)

if spacesPropfind {
res.Info.Path = ref.Path
Expand Down Expand Up @@ -331,7 +327,6 @@ func (s *svc) getResourceInfos(ctx context.Context, w http.ResponseWriter, r *ht
Ref: ref,
ArbitraryMetadataKeys: metadataKeys,
}
fmt.Println("debugging: ListContainer: ", req)
res, err := client.ListContainer(ctx, req)
if err != nil {
log.Error().Err(err).Msg("error sending list container grpc request")
Expand All @@ -343,7 +338,6 @@ func (s *svc) getResourceInfos(ctx context.Context, w http.ResponseWriter, r *ht
HandleErrorStatus(&log, w, res.Status)
return nil, nil, false
}
fmt.Println("debugging: ListContainer: ", res)
resourceInfos = append(resourceInfos, res.Infos...)

case depth == "infinity":
Expand Down
2 changes: 0 additions & 2 deletions internal/http/services/owncloud/ocdav/webdav.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package ocdav

import (
"fmt"
"net/http"
"path"
)
Expand Down Expand Up @@ -97,7 +96,6 @@ func (h *WebDavHandler) init(ns string, useLoggedInUserNS bool) error {
func (h *WebDavHandler) Handler(s *svc) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ns := applyLayout(r.Context(), h.namespace, h.useLoggedInUserNS, r.URL.Path)
fmt.Println("debugging webdav layout: ", ns, r.Context(), h.namespace, h.useLoggedInUserNS, r.URL.Path)
switch r.Method {
case MethodPropfind:
s.handlePathPropfind(w, r, ns)
Expand Down

0 comments on commit 6b0f9b3

Please sign in to comment.