Handles upper case characters in the cached state file's remote type
If the cached state file contains a remote type field with upper case characters, eg 'Consul', it was no longer possible to find the 'consul' remote plugin.
This commit is contained in:
parent
816c4b475f
commit
428fd98ba0
|
@ -4,6 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/hashicorp/errwrap"
|
"github.com/hashicorp/errwrap"
|
||||||
"github.com/hashicorp/terraform/state"
|
"github.com/hashicorp/terraform/state"
|
||||||
|
@ -208,7 +209,7 @@ func remoteState(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize the remote client based on the local state
|
// Initialize the remote client based on the local state
|
||||||
client, err := remote.NewClient(local.Remote.Type, local.Remote.Config)
|
client, err := remote.NewClient(strings.ToLower(local.Remote.Type), local.Remote.Config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errwrap.Wrapf(fmt.Sprintf(
|
return nil, errwrap.Wrapf(fmt.Sprintf(
|
||||||
"Error initializing remote driver '%s': {{err}}",
|
"Error initializing remote driver '%s': {{err}}",
|
||||||
|
|
Loading…
Reference in New Issue