Swift storageUrl overloading fixes #167

This commit is contained in:
Xavier Lucas 2016-02-02 20:45:05 +01:00 committed by Nick Craig-Wood
parent 08a8f7174a
commit c2e8f06bfa
3 changed files with 42 additions and 0 deletions

View file

@ -66,6 +66,9 @@ func init() {
}, {
Name: "region",
Help: "Region name - optional",
}, {
Name: "storage_url",
Help: "Storage URL - optional",
},
},
})
@ -176,6 +179,12 @@ func NewFsWithConnection(name, root string, c *swift.Connection) (fs.Fs, error)
segmentsContainer: container + "_segments",
root: directory,
}
// StorageURL overloading
storageURL := fs.ConfigFile.MustValue(name, "storage_url")
if storageURL != "" {
f.c.StorageUrl = storageURL
f.c.Auth = newAuth(f.c.Auth, storageURL)
}
if f.root != "" {
f.root += "/"
// Check to see if the object exists - ignoring directory markers