pass command credentials into module.Storage

This commit is contained in:
James Bardin 2017-10-27 15:16:58 -04:00
parent 4e8fe97556
commit 5203c66116
2 changed files with 6 additions and 10 deletions

View File

@ -107,10 +107,8 @@ func testModule(t *testing.T, name string) *module.Tree {
t.Fatalf("err: %s", err) t.Fatalf("err: %s", err)
} }
s := &module.Storage{ s := module.NewStorage(tempDir(t), nil, nil)
StorageDir: tempDir(t), s.Mode = module.GetModeGet
Mode: module.GetModeGet,
}
if err := mod.Load(s); err != nil { if err := mod.Load(s); err != nil {
t.Fatalf("err: %s", err) t.Fatalf("err: %s", err)
} }

View File

@ -369,12 +369,10 @@ func (m *Meta) flagSet(n string) *flag.FlagSet {
// moduleStorage returns the module.Storage implementation used to store // moduleStorage returns the module.Storage implementation used to store
// modules for commands. // modules for commands.
func (m *Meta) moduleStorage(root string, mode module.GetMode) *module.Storage { func (m *Meta) moduleStorage(root string, mode module.GetMode) *module.Storage {
return &module.Storage{ s := module.NewStorage(filepath.Join(root, "modules"), m.Services, m.Credentials)
StorageDir: filepath.Join(root, "modules"), s.Ui = m.Ui
Services: m.Services, s.Mode = mode
Ui: m.Ui, return s
Mode: mode,
}
} }
// process will process the meta-parameters out of the arguments. This // process will process the meta-parameters out of the arguments. This