From e238f31df43cc4875861657712b23f57a5e15e0c Mon Sep 17 00:00:00 2001 From: Zexi Li Date: Wed, 11 May 2022 08:29:38 +0800 Subject: [PATCH] fix(region): get spec of baremetal in ready status (#14233) --- pkg/compute/models/hosts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/compute/models/hosts.go b/pkg/compute/models/hosts.go index b03a24b6ce..2f5076b062 100644 --- a/pkg/compute/models/hosts.go +++ b/pkg/compute/models/hosts.go @@ -1204,7 +1204,7 @@ func (self *SHost) GetSpec(statusCheck bool) *jsonutils.JSONDict { if !self.GetEnabled() { return nil } - if self.Status != api.BAREMETAL_RUNNING || self.GetBaremetalServer() != nil || self.IsMaintenance { + if !utils.IsInStringArray(self.Status, []string{api.BAREMETAL_RUNNING, api.BAREMETAL_READY}) || self.GetBaremetalServer() != nil || self.IsMaintenance { return nil } if self.MemSize == 0 || self.CpuCount == 0 {