From c5897e0d62be5386b4ba94444cac3a69bf9fe08c Mon Sep 17 00:00:00 2001 From: Jan Niehusmann Date: Mon, 5 Dec 2016 23:12:30 +0100 Subject: [PATCH] Update debug message Since client.BucketExists was changed to return a separate 'found' value, instead of reporting an error when the bucket doesn't exist, the error code path does no longer imply a call to client.MakeBucket. So the second part of the debug message, "...trying to create the bucket" doesn't apply any more. Also, changed the name of the return value from 'ok' to 'found', matching the API documentation at https://docs.minio.io/docs/golang-client-api-reference#BucketExists. --- src/restic/backend/s3/s3.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/restic/backend/s3/s3.go b/src/restic/backend/s3/s3.go index 5a79567ed..56a6833cc 100644 --- a/src/restic/backend/s3/s3.go +++ b/src/restic/backend/s3/s3.go @@ -37,13 +37,13 @@ func Open(cfg Config) (restic.Backend, error) { be := &s3{client: client, bucketname: cfg.Bucket, prefix: cfg.Prefix} be.createConnections() - ok, err := client.BucketExists(cfg.Bucket) + found, err := client.BucketExists(cfg.Bucket) if err != nil { - debug.Log("BucketExists(%v) returned err %v, trying to create the bucket", cfg.Bucket, err) + debug.Log("BucketExists(%v) returned err %v", cfg.Bucket, err) return nil, errors.Wrap(err, "client.BucketExists") } - if !ok { + if !found { // create new bucket with default ACL in default region err = client.MakeBucket(cfg.Bucket, "") if err != nil {