swift: add support for non-default project domain.

With Keystone V3 both users and projects (a.k.a. tenants) can belong
to different domains. This change allow specifying different domains
for the user and the project.
This commit is contained in:
Antonio Messina 2016-07-05 18:34:22 +02:00 committed by Nick Craig-Wood
parent a20d80565b
commit 02a3bbaa3d
2 changed files with 6 additions and 0 deletions

View File

@ -76,6 +76,8 @@ User domain - optional (v3 auth)
domain> Default
Tenant name - optional
tenant>
Tenant domain - optional (v3 auth)
tenant_domain>
Region name - optional
region>
Storage URL - optional

View File

@ -67,6 +67,9 @@ func init() {
}, {
Name: "tenant",
Help: "Tenant name - optional",
}, {
Name: "tenant_domain",
Help: "Tenant domain - optional (v3 auth)",
}, {
Name: "region",
Help: "Region name - optional",
@ -163,6 +166,7 @@ func swiftConnection(name string) (*swift.Connection, error) {
Tenant: fs.ConfigFile.MustValue(name, "tenant"),
Region: fs.ConfigFile.MustValue(name, "region"),
Domain: fs.ConfigFile.MustValue(name, "domain"),
TenantDomain: fs.ConfigFile.MustValue(name, "tenant_domain"),
ConnectTimeout: 10 * fs.Config.ConnectTimeout, // Use the timeouts in the transport
Timeout: 10 * fs.Config.Timeout, // Use the timeouts in the transport
Transport: fs.Config.Transport(),