fix(region): vm bill type sync

This commit is contained in:
ioito
2023-02-24 11:52:13 +08:00
parent 394e6387e9
commit 40a3a09c1f
+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 {