fix(region): hostname sync (#15659)

This commit is contained in:
屈轩
2022-12-29 23:19:14 +08:00
committed by GitHub
parent fdc4467042
commit a85c17a64b

View File

@@ -2745,8 +2745,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()