fix(region): baremetal spec condition

This commit is contained in:
Zexi Li
2021-07-30 17:07:27 +08:00
parent 794c3cc34e
commit e3a15c04d2
+1 -2
View File
@@ -1118,8 +1118,7 @@ func (self *SHost) GetSpec(statusCheck bool) *jsonutils.JSONDict {
if !self.GetEnabled() {
return nil
}
if utils.IsInStringArray(self.Status, []string{api.BAREMETAL_INIT, api.BAREMETAL_PREPARE_FAIL, api.BAREMETAL_PREPARE}) ||
self.GetBaremetalServer() != nil {
if self.Status != api.BAREMETAL_RUNNING || self.GetBaremetalServer() != nil || self.IsMaintenance {
return nil
}
if self.MemSize == 0 || self.CpuCount == 0 {