fix(region): sync vm hostname with ascii (#15562)

This commit is contained in:
屈轩
2022-12-16 16:06:46 +08:00
committed by GitHub
parent 30a9da1fe4
commit 77a0cf0646
+2 -2
View File
@@ -2849,7 +2849,7 @@ func (self *SGuest) syncWithCloudVM(ctx context.Context, userCred mcclient.Token
}
}
if extVM.GetName() != extVM.GetHostname() {
self.Hostname = extVM.GetHostname()
self.Hostname = pinyinutils.Text2Pinyin(extVM.GetHostname())
}
if !self.IsFailureStatus() && syncStatus {
self.Status = extVM.GetStatus()
@@ -2965,7 +2965,7 @@ func (manager *SGuestManager) newCloudVM(ctx context.Context, userCred mcclient.
guest.Bios = string(extVM.GetBios())
guest.Machine = extVM.GetMachine()
guest.Hypervisor = extVM.GetHypervisor()
guest.Hostname = extVM.GetHostname()
guest.Hostname = pinyinutils.Text2Pinyin(extVM.GetHostname())
guest.InternetMaxBandwidthOut = extVM.GetInternetMaxBandwidthOut()
guest.Throughput = extVM.GetThroughput()