command/apply: remove remote package
This commit is contained in:
parent
0c6d133d61
commit
0fcc417ddd
|
@ -15,7 +15,6 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform/remote"
|
|
||||||
"github.com/hashicorp/terraform/terraform"
|
"github.com/hashicorp/terraform/terraform"
|
||||||
"github.com/mitchellh/cli"
|
"github.com/mitchellh/cli"
|
||||||
)
|
)
|
||||||
|
@ -408,8 +407,9 @@ func TestApply_plan_remoteState(t *testing.T) {
|
||||||
defer func() { test = true }()
|
defer func() { test = true }()
|
||||||
tmp, cwd := testCwd(t)
|
tmp, cwd := testCwd(t)
|
||||||
defer testFixCwd(t, tmp, cwd)
|
defer testFixCwd(t, tmp, cwd)
|
||||||
if err := remote.EnsureDirectory(); err != nil {
|
remoteStatePath := filepath.Join(tmp, DefaultDataDir, DefaultStateFilename)
|
||||||
t.Fatalf("err: %v", err)
|
if err := os.MkdirAll(filepath.Dir(remoteStatePath), 0755); err != nil {
|
||||||
|
t.Fatalf("err: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set some default reader/writers for the inputs
|
// Set some default reader/writers for the inputs
|
||||||
|
@ -448,21 +448,13 @@ func TestApply_plan_remoteState(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// State file should be not be installed
|
// State file should be not be installed
|
||||||
exists, err := remote.ExistsFile(DefaultStateFilename)
|
if _, err := os.Stat(filepath.Join(tmp, DefaultStateFilename)); err == nil {
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("err: %v", err)
|
|
||||||
}
|
|
||||||
if exists {
|
|
||||||
t.Fatalf("State path should not exist")
|
t.Fatalf("State path should not exist")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for remote state
|
// Check for remote state
|
||||||
output, _, err := remote.ReadLocalState()
|
if _, err := os.Stat(remoteStatePath); err != nil {
|
||||||
if err != nil {
|
t.Fatalf("missing remote state: %s", err)
|
||||||
t.Fatalf("err: %v", err)
|
|
||||||
}
|
|
||||||
if output == nil {
|
|
||||||
t.Fatalf("missing remote state")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue