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