fix(region): not set baremetal is_maintenance when action is start

This commit is contained in:
Zexi Li
2021-08-09 15:22:05 +08:00
parent a4dd439f77
commit dc819e77fc

View File

@@ -52,10 +52,12 @@ func (self *BaremetalMaintenanceTask) OnEnterMaintenantModeSucc(ctx context.Cont
if len(action) > 0 {
logclient.AddActionLogWithStartable(self, baremetal, action, "", self.UserCred, true)
}
db.Update(baremetal, func() error {
baremetal.IsMaintenance = true
return nil
})
if action != logclient.ACT_VM_START {
db.Update(baremetal, func() error {
baremetal.IsMaintenance = true
return nil
})
}
username, _ := body.Get("username")
password, _ := body.Get("password")
ip, _ := body.Get("ip")