From 9998e077dfd70a0c1189f1a9b5d7ab25a6e01b79 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Sinha Date: Thu, 2 Aug 2018 22:45:54 +0530 Subject: [PATCH] Remove error statement in mc mirror (#2500) mc mirror complains about extra file in destination, but this is not an error so removed the error message. Fixes: #2470 --- cmd/mirror-main.go | 2 +- cmd/mirror-url.go | 4 ---- cmd/typed-errors.go | 7 ------- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/cmd/mirror-main.go b/cmd/mirror-main.go index c51b30b3..b36b2a1b 100644 --- a/cmd/mirror-main.go +++ b/cmd/mirror-main.go @@ -590,7 +590,7 @@ func (mj *mirrorJob) mirror(ctx context.Context, cancelMirror context.CancelFunc PathInsufficientPermission, ObjectOnGlacier: errorIf(err, "Unable to perform a mirror action.") continue - case deleteNotAllowedErr, overwriteNotAllowedErr: + case overwriteNotAllowedErr: errorIf(err, "Unable to perform a mirror action.") continue } diff --git a/cmd/mirror-url.go b/cmd/mirror-url.go index 3a84bbb5..d84b4d3a 100644 --- a/cmd/mirror-url.go +++ b/cmd/mirror-url.go @@ -178,10 +178,6 @@ func deltaSourceTarget(sourceURL, targetURL string, isFake, isOverwrite, isRemov } case differInSecond: if !isRemove && !isFake { - // Object removal not allowed if --remove is not set. - URLsCh <- URLs{ - Error: errDeleteNotAllowed(diffMsg.SecondURL), - } continue } URLsCh <- URLs{ diff --git a/cmd/typed-errors.go b/cmd/typed-errors.go index a656da8b..3f1d371f 100644 --- a/cmd/typed-errors.go +++ b/cmd/typed-errors.go @@ -103,13 +103,6 @@ var errOverWriteNotAllowed = func(URL string) *probe.Error { return probe.NewError(overwriteNotAllowedErr(errors.New(msg))) } -type deleteNotAllowedErr error - -var errDeleteNotAllowed = func(URL string) *probe.Error { - msg := "Delete not allowed for `" + URL + "`. Use `--remove` to override this behavior." - return probe.NewError(deleteNotAllowedErr(errors.New(msg))) -} - type sourceIsDirErr error var errSourceIsDir = func(URL string) *probe.Error {