Only pass the project if it is specified

This commit is contained in:
Justin Santa Barbara 2013-09-02 10:22:14 -07:00
parent b6a6c8571b
commit 47ee7ca977
1 changed files with 4 additions and 1 deletions

View File

@ -40,10 +40,13 @@ func (c *AccessConfig) Auth() (gophercloud.AccessProvider, error) {
authoptions := gophercloud.AuthOptions{
Username: username,
Password: password,
TenantName: project,
AllowReauth: true,
}
if project != "" {
authoptions.TenantName = project
}
return gophercloud.Authenticate(provider, authoptions)
}