mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
修正:旧的服务器没有os_type字段
This commit is contained in:
@@ -1232,6 +1232,9 @@ func (self *SGuest) GetExtraDetails(ctx context.Context, userCred mcclient.Token
|
||||
osName := self.GetOS()
|
||||
if len(osName) > 0 {
|
||||
extra.Add(jsonutils.NewString(osName), "os_name")
|
||||
if len(self.OsType) == 0 {
|
||||
extra.Add(jsonutils.NewString(osName), "os_type")
|
||||
}
|
||||
}
|
||||
if metaData, err := self.GetAllMetadata(userCred); err == nil {
|
||||
extra.Add(jsonutils.Marshal(metaData), "metadata")
|
||||
|
||||
Reference in New Issue
Block a user