mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-20 08:03:53 +08:00
fix(baremetal): panic when save desc (#21867)
This commit is contained in:
@@ -630,8 +630,10 @@ func (b *SBaremetalInstance) SaveDesc(ctx context.Context, desc jsonutils.JSONOb
|
||||
b.descLock.Lock()
|
||||
defer b.descLock.Unlock()
|
||||
if desc != nil {
|
||||
if desc != nil && b.desc != nil && b.desc.Contains("server_id") && !desc.Contains("server_id") {
|
||||
desc.(*jsonutils.JSONDict).Set("server_id", jsonutils.NewString(b.server.GetId()))
|
||||
if b.desc != nil && b.desc.Contains("server_id") && !desc.Contains("server_id") {
|
||||
if b.server != nil {
|
||||
desc.(*jsonutils.JSONDict).Set("server_id", jsonutils.NewString(b.server.GetId()))
|
||||
}
|
||||
}
|
||||
b.desc = desc.(*jsonutils.JSONDict)
|
||||
if b.desc.Contains("sys_info") {
|
||||
|
||||
Reference in New Issue
Block a user