leave auth options untouched in authv3
diff --git a/openstack/client.go b/openstack/client.go
index baa4cb5..951f4ed 100644
--- a/openstack/client.go
+++ b/openstack/client.go
@@ -134,13 +134,17 @@
v3Client.Endpoint = endpoint
}
+ // copy the auth options to a local variable that we can change. `options`
+ // needs to stay as-is for reauth purposes
+ v3Options := options
+
var scope *tokens3.Scope
if options.TenantID != "" {
scope = &tokens3.Scope{
ProjectID: options.TenantID,
}
- options.TenantID = ""
- options.TenantName = ""
+ v3Options.TenantID = ""
+ v3Options.TenantName = ""
} else {
if options.TenantName != "" {
scope = &tokens3.Scope{
@@ -148,11 +152,11 @@
DomainID: options.DomainID,
DomainName: options.DomainName,
}
- options.TenantName = ""
+ v3Options.TenantName = ""
}
}
- result := tokens3.Create(v3Client, options, scope)
+ result := tokens3.Create(v3Client, v3Options, scope)
token, err := result.ExtractToken()
if err != nil {