make terraform work with ModuleStorage

This commit is contained in:
James Bardin 2017-10-27 13:06:07 -04:00
parent f2a7b94692
commit 70a5b1b734
1 changed files with 8 additions and 5 deletions

View File

@ -12,7 +12,6 @@ import (
"sync" "sync"
"testing" "testing"
"github.com/hashicorp/go-getter"
"github.com/hashicorp/terraform/config" "github.com/hashicorp/terraform/config"
"github.com/hashicorp/terraform/config/module" "github.com/hashicorp/terraform/config/module"
"github.com/hashicorp/terraform/helper/experiment" "github.com/hashicorp/terraform/helper/experiment"
@ -97,8 +96,11 @@ func testModule(t *testing.T, name string) *module.Tree {
t.Fatalf("err: %s", err) t.Fatalf("err: %s", err)
} }
s := &getter.FolderStorage{StorageDir: tempDir(t)} s := &module.ModuleStorage{
if err := mod.Load(s, module.GetModeGet); err != nil { StorageDir: tempDir(t),
Mode: module.GetModeGet,
}
if err := mod.Load(s); err != nil {
t.Fatalf("err: %s", err) t.Fatalf("err: %s", err)
} }
@ -144,10 +146,11 @@ func testModuleInline(t *testing.T, config map[string]string) *module.Tree {
} }
// Load the modules // Load the modules
modStorage := &getter.FolderStorage{ modStorage := &module.ModuleStorage{
StorageDir: filepath.Join(cfgPath, ".tfmodules"), StorageDir: filepath.Join(cfgPath, ".tfmodules"),
Mode: module.GetModeGet,
} }
err = mod.Load(modStorage, module.GetModeGet) err = mod.Load(modStorage)
if err != nil { if err != nil {
t.Errorf("Error downloading modules: %s", err) t.Errorf("Error downloading modules: %s", err)
} }