From 428fd98ba0d6273be0d57802ed444552387e67f6 Mon Sep 17 00:00:00 2001 From: Koen De Causmaecker Date: Wed, 1 Apr 2015 21:42:39 +0200 Subject: [PATCH] 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. --- command/state.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/command/state.go b/command/state.go index da34cfb2f..5b8b3d594 100644 --- a/command/state.go +++ b/command/state.go @@ -4,6 +4,7 @@ import ( "fmt" "os" "path/filepath" + "strings" "github.com/hashicorp/errwrap" "github.com/hashicorp/terraform/state" @@ -208,7 +209,7 @@ func remoteState( } // 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 { return nil, errwrap.Wrapf(fmt.Sprintf( "Error initializing remote driver '%s': {{err}}",