Use project for host capabilities
This commit is contained in:
parent
2d7ce1b9d8
commit
7cc07642a5
@ -257,14 +257,6 @@ func (b *Basis) Host() (host core.Host, err error) {
|
||||
return nil, fmt.Errorf("failed to detect host plugin for current platform")
|
||||
}
|
||||
|
||||
if s, ok := result.(core.Seeder); ok {
|
||||
if err = s.Seed(b.statebag); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
return nil, fmt.Errorf("host plugin does not support seeder interface")
|
||||
}
|
||||
|
||||
b.logger.Info("host detection complete",
|
||||
"name", result_name)
|
||||
|
||||
|
||||
@ -114,7 +114,20 @@ func (p *Project) DefaultPrivateKey() (path string, err error) {
|
||||
|
||||
// Host implements core.Project
|
||||
func (p *Project) Host() (host core.Host, err error) {
|
||||
return p.basis.Host()
|
||||
if host, err = p.basis.Host(); err != nil {
|
||||
return
|
||||
}
|
||||
if s, ok := host.(core.Seeder); ok {
|
||||
list, err := s.Seeds()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
list = append(list, p)
|
||||
if err = s.Seed(list...); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// MachineIndex implements core.Project
|
||||
|
||||
@ -12,7 +12,7 @@ module VagrantPlugins
|
||||
default_args = [
|
||||
# Always get the state bag for host capabilities
|
||||
SDK::FuncSpec::Value.new(
|
||||
type: "hashicorp.vagrant.sdk.Args.StateBag",
|
||||
type: "hashicorp.vagrant.sdk.Args.Project",
|
||||
name: "",
|
||||
),
|
||||
]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user