Ensure config is set on basis/project during init
This commit is contained in:
parent
df42e88aab
commit
766b951040
@ -137,6 +137,15 @@ func (b *Basis) Init() error {
|
||||
}
|
||||
}
|
||||
|
||||
// If our reloaded data does not include any configuration
|
||||
// stub in a default value
|
||||
if b.basis.Configuration == nil {
|
||||
b.basis.Configuration = &vagrant_server.Vagrantfile{
|
||||
Unfinalized: &vagrant_plugin_sdk.Args_Hash{},
|
||||
Format: vagrant_server.Vagrantfile_RUBY,
|
||||
}
|
||||
}
|
||||
|
||||
// If the basis directory is unset, set it
|
||||
if b.dir == nil {
|
||||
if b.dir, err = datadir.NewBasis(b.basis.Name); err != nil {
|
||||
|
||||
@ -118,6 +118,15 @@ func (p *Project) Init() error {
|
||||
}
|
||||
}
|
||||
|
||||
// If our reloaded data does not include any configuration
|
||||
// stub in a default value
|
||||
if p.project.Configuration == nil {
|
||||
p.project.Configuration = &vagrant_server.Vagrantfile{
|
||||
Unfinalized: &vagrant_plugin_sdk.Args_Hash{},
|
||||
Format: vagrant_server.Vagrantfile_RUBY,
|
||||
}
|
||||
}
|
||||
|
||||
// If we don't have a basis set, load it
|
||||
if p.basis == nil {
|
||||
p.basis, err = p.factory.NewBasis(p.project.Basis.ResourceId, WithBasisRef(p.project.Basis))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user