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)
}
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)
}

View File

@ -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