Merge pull request #11758 from zexi/fix-baremetal-spec

fix(region): baremetal spec condition
This commit is contained in:
yunion-ci-robot
2021-07-31 01:47:36 +08:00
committed by GitHub
+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 {