From 5203c661166fc63e72cbbbee8979a4da3cb3a300 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Fri, 27 Oct 2017 15:16:58 -0400 Subject: [PATCH] pass command credentials into module.Storage --- command/command_test.go | 6 ++---- command/meta.go | 10 ++++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/command/command_test.go b/command/command_test.go index a789eebabd..bf6fee7c24 100644 --- a/command/command_test.go +++ b/command/command_test.go @@ -107,10 +107,8 @@ func testModule(t *testing.T, name string) *module.Tree { t.Fatalf("err: %s", err) } - s := &module.Storage{ - StorageDir: tempDir(t), - Mode: module.GetModeGet, - } + s := module.NewStorage(tempDir(t), nil, nil) + s.Mode = module.GetModeGet if err := mod.Load(s); err != nil { t.Fatalf("err: %s", err) } diff --git a/command/meta.go b/command/meta.go index b00c80d48f..e45c40a771 100644 --- a/command/meta.go +++ b/command/meta.go @@ -369,12 +369,10 @@ func (m *Meta) flagSet(n string) *flag.FlagSet { // moduleStorage returns the module.Storage implementation used to store // modules for commands. func (m *Meta) moduleStorage(root string, mode module.GetMode) *module.Storage { - return &module.Storage{ - StorageDir: filepath.Join(root, "modules"), - Services: m.Services, - Ui: m.Ui, - Mode: mode, - } + s := module.NewStorage(filepath.Join(root, "modules"), m.Services, m.Credentials) + s.Ui = m.Ui + s.Mode = mode + return s } // process will process the meta-parameters out of the arguments. This