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)
|
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)
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue