pass command credentials into module.Storage
This commit is contained in:
parent
4e8fe97556
commit
5203c66116
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue