"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
swift: make sensible error if the user forgets the container - fixes #1470
Nick Craig-Wood2ca477c57f6e
diff --git a/swift/swift.go b/swift/swift.goindex 63933d2b2..6d1e49bc9 100644--- a/swift/swift.go+++ b/swift/swift.go@@ -418,6 +418,10 @@ func (f *Fs) Mkdir(dir string) error {if f.containerOK {return nil}+ // if we are at the root, then it is OK+ if f.container == "" {+ return nil+ }// Check to see if container exists first_, _, err := f.c.Container(f.container)if err == swift.ContainerNotFound {@@ -747,6 +751,9 @@ func (o *Object) updateChunks(in io.Reader, headers swift.Headers, size int64, c//// The new object may have been created if an error is returnedfunc (o *Object) Update(in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error {+ if o.fs.container == "" {+ return fs.FatalError(errors.New("container name needed in remote"))+ }err := o.fs.Mkdir("")if err != nil {return err