fix(region): vm gpu notes (#18651)

This commit is contained in:
屈轩
2023-11-13 18:15:33 +08:00
committed by GitHub
parent bb3f8eba9f
commit f0b9b735c1
+4 -3
View File
@@ -5184,9 +5184,6 @@ func (self *SGuest) GetSpec(checkStatus bool) *jsonutils.JSONDict {
gpuSpecs = append(gpuSpecs, *gs)
}
}
if gs := self.GetGpuSpec(); gs != nil {
gpuSpecs = append(gpuSpecs, *gs)
}
spec.Set("gpu", jsonutils.Marshal(gpuSpecs))
return spec
@@ -5283,6 +5280,10 @@ func (self *SGuest) GetShortDesc(ctx context.Context) *jsonutils.JSONDict {
if len(self.InstanceType) > 0 {
desc.Set("instance_type", jsonutils.NewString(self.InstanceType))
}
if gp := self.GetGpuSpec(); gp != nil {
desc.Set("gpu_model", jsonutils.NewString(gp.Model))
desc.Set("gpu_count", jsonutils.NewString(gp.Amount))
}
address := jsonutils.NewString(strings.Join(self.GetRealIPs(), ","))
desc.Set("ip_addr", address)