Merge pull request #16032 from ioito/hotfix/qx-vm-bill-type-sync

fix(region): vm bill type sync
This commit is contained in:
Zexi Li
2023-02-24 16:44:47 +08:00
committed by GitHub
+1 -11
View File
@@ -2905,23 +2905,13 @@ func (self *SGuest) syncWithCloudVM(ctx context.Context, userCred mcclient.Token
self.IsEmulated = extVM.IsEmulated()
if provider.GetFactory().IsSupportPrepaidResources() && !recycle &&
!extVM.GetExpiredAt().IsZero() {
if provider.GetFactory().IsSupportPrepaidResources() && !recycle {
self.BillingType = extVM.GetBillingType()
self.ExpiredAt = extVM.GetExpiredAt()
if self.GetDriver().IsSupportSetAutoRenew() {
self.AutoRenew = extVM.IsAutoRenew()
}
}
// no need to sync CreatedAt
// if !recycle {
// if createdAt := extVM.GetCreatedAt(); !createdAt.IsZero() {
// self.CreatedAt = createdAt
// }
// }
return nil
})
if err != nil {