fix(region): hostname sync (#15657)

This commit is contained in:
屈轩
2022-12-29 23:19:06 +08:00
committed by GitHub
parent b2be76af46
commit 47bcf2e9d9
+3 -2
View File
@@ -2851,8 +2851,9 @@ func (self *SGuest) syncWithCloudVM(ctx context.Context, userCred mcclient.Token
self.Name = newName
}
}
if extVM.GetName() != extVM.GetHostname() {
self.Hostname = pinyinutils.Text2Pinyin(extVM.GetHostname())
hostname := pinyinutils.Text2Pinyin(extVM.GetHostname())
if extVM.GetName() != hostname {
self.Hostname = hostname
}
if !self.IsFailureStatus() && syncStatus {
self.Status = extVM.GetStatus()