Delete machine from db

This commit is contained in:
sophia 2022-01-20 12:33:04 -06:00 committed by Paul Hinze
parent 3dbd9286be
commit 896cdea21f
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0

View File

@ -35,13 +35,11 @@ func (m *Machine) ID() (id string, err error) {
// SetID implements core.Machine // SetID implements core.Machine
func (m *Machine) SetID(value string) (err error) { func (m *Machine) SetID(value string) (err error) {
if value == "" { if value == "" {
err = m.Destroy() return m.Destroy()
if err != nil { } else {
return err m.machine.Id = value
} return m.SaveMachine()
} }
m.machine.Id = value
return m.SaveMachine()
} }
func (m *Machine) Box() (b core.Box, err error) { func (m *Machine) Box() (b core.Box, err error) {