mirror of
https://github.com/rclone/rclone.git
synced 2024-11-23 05:33:11 +08:00
azureblob: list the container to see if it exists #2118
This means that SAS URLs which are tied to a single container will work.
This commit is contained in:
parent
b062ae9d13
commit
72392a2d72
|
@ -573,10 +573,19 @@ func (f *Fs) Mkdir(dir string) error {
|
|||
if f.containerOK {
|
||||
return nil
|
||||
}
|
||||
// List the container to see if it exists
|
||||
err := f.list("", false, 1, func(remote string, object *storage.Blob, isDirectory bool) error {
|
||||
return nil
|
||||
})
|
||||
if err == nil {
|
||||
f.markContainerOK()
|
||||
return nil
|
||||
}
|
||||
// now try to create the container
|
||||
options := storage.CreateContainerOptions{
|
||||
Access: storage.ContainerAccessTypePrivate,
|
||||
}
|
||||
err := f.pacer.Call(func() (bool, error) {
|
||||
err = f.pacer.Call(func() (bool, error) {
|
||||
err := f.cc.Create(&options)
|
||||
if err != nil {
|
||||
if storageErr, ok := err.(storage.AzureStorageServiceError); ok {
|
||||
|
|
Loading…
Reference in New Issue
Block a user