backend/swift: Fix interface after upgrade

This commit is contained in:
Radek Simko 2019-02-08 10:54:42 +00:00
parent a67e6e19b1
commit a7f0722729
No known key found for this signature in database
GPG Key ID: 1F1C84FE689A88D7
1 changed files with 6 additions and 2 deletions

View File

@ -109,7 +109,7 @@ func New() backend.Backend {
"insecure": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("OS_INSECURE", ""),
DefaultFunc: schema.EnvDefaultFunc("OS_INSECURE", nil),
Description: descriptions["insecure"],
},
@ -256,7 +256,6 @@ func (b *Backend) configure(ctx context.Context) error {
DomainName: data.Get("domain_name").(string),
EndpointType: data.Get("endpoint_type").(string),
IdentityEndpoint: data.Get("auth_url").(string),
Insecure: data.Get("insecure").(bool),
Password: data.Get("password").(string),
Token: data.Get("token").(string),
TenantID: data.Get("tenant_id").(string),
@ -265,6 +264,11 @@ func (b *Backend) configure(ctx context.Context) error {
UserID: data.Get("user_id").(string),
}
if v, ok := data.GetOkExists("insecure"); ok {
insecure := v.(bool)
config.Insecure = &insecure
}
if err := config.LoadAndValidate(); err != nil {
return err
}