mirror of
https://github.com/hashicorp/vagrant.git
synced 2026-06-14 19:20:01 -04:00
Merge targets with upserting
This commit is contained in:
parent
12de22a7db
commit
3dbd9286be
2 changed files with 2 additions and 9 deletions
|
|
@ -29,15 +29,6 @@ func (m *Machine) Close() (err error) {
|
|||
|
||||
// ID implements core.Machine
|
||||
func (m *Machine) ID() (id string, err error) {
|
||||
// Sometimes the machine id does not get set, so set it here.
|
||||
// TODO: This is maybe a symptom of a different problem
|
||||
if m.target.Uuid != m.machine.Id {
|
||||
m.machine.Id = m.target.Uuid
|
||||
err = m.SaveMachine()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
return m.machine.Id, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -194,6 +194,8 @@ func (s *State) targetPut(
|
|||
return erro
|
||||
}
|
||||
if foundTarget != nil {
|
||||
// Merge found target with provided target
|
||||
proto.Merge(value, foundTarget)
|
||||
value.ResourceId = foundTarget.ResourceId
|
||||
value.Uuid = foundTarget.Uuid
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue