From e3a15c04d2743841aa57a0579a8b0b8b580da831 Mon Sep 17 00:00:00 2001 From: Zexi Li Date: Fri, 30 Jul 2021 17:07:27 +0800 Subject: [PATCH] fix(region): baremetal spec condition --- pkg/compute/models/hosts.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/compute/models/hosts.go b/pkg/compute/models/hosts.go index 4c5d1b6610..b0f2554da7 100644 --- a/pkg/compute/models/hosts.go +++ b/pkg/compute/models/hosts.go @@ -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 {