public cloud support postpaid expire

This commit is contained in:
wanyaoqi
2019-12-30 11:19:20 +08:00
parent 53972dc1ec
commit 4767d1d536
5 changed files with 2 additions and 39 deletions
+2 -3
View File
@@ -251,7 +251,7 @@ func (self *SBaseGuestDriver) IsSupportedBillingCycle(bc billing.SBillingCycle)
}
func (self *SBaseGuestDriver) IsSupportPostpaidExpire() bool {
return false
return true
}
func (self *SBaseGuestDriver) RequestRenewInstance(guest *models.SGuest, bc billing.SBillingCycle) (time.Time, error) {
@@ -324,6 +324,5 @@ func (self *SBaseGuestDriver) RequestSyncSecgroupsOnHost(ctx context.Context, gu
func (self *SBaseGuestDriver) CancelExpireTime(
ctx context.Context, userCred mcclient.TokenCredential, guest *models.SGuest) error {
return httperrors.NewBadRequestError("unsupport cancel expire time")
return guest.CancelExpireTime(ctx, userCred)
}
-9
View File
@@ -284,15 +284,6 @@ func (self *SESXiGuestDriver) RequestAssociateEip(ctx context.Context, userCred
return fmt.Errorf("ESXiGuestDriver not support associate eip")
}
func (self *SESXiGuestDriver) CancelExpireTime(
ctx context.Context, userCred mcclient.TokenCredential, guest *models.SGuest) error {
return guest.CancelExpireTime(ctx, userCred)
}
func (self *SESXiGuestDriver) IsSupportPostpaidExpire() bool {
return true
}
func (self *SESXiGuestDriver) IsSupportCdrom(guest *models.SGuest) (bool, error) {
return false, nil
}
-9
View File
@@ -484,15 +484,6 @@ func (self *SKVMGuestDriver) OnGuestChangeCpuMemFailed(ctx context.Context, gues
return nil
}
func (self *SKVMGuestDriver) CancelExpireTime(
ctx context.Context, userCred mcclient.TokenCredential, guest *models.SGuest) error {
return guest.CancelExpireTime(ctx, userCred)
}
func (self *SKVMGuestDriver) IsSupportCdrom(guest *models.SGuest) (bool, error) {
return true, nil
}
func (self *SKVMGuestDriver) IsSupportPostpaidExpire() bool {
return true
}
-9
View File
@@ -321,12 +321,3 @@ func (self *SOpenStackGuestDriver) AllowReconfigGuest() bool {
func (self *SOpenStackGuestDriver) IsSupportedBillingCycle(bc billing.SBillingCycle) bool {
return false
}
func (self *SOpenStackGuestDriver) IsSupportPostpaidExpire() bool {
return true
}
func (self *SOpenStackGuestDriver) CancelExpireTime(
ctx context.Context, userCred mcclient.TokenCredential, guest *models.SGuest) error {
return guest.CancelExpireTime(ctx, userCred)
}
-9
View File
@@ -169,12 +169,3 @@ func (self *SZStackGuestDriver) AllowReconfigGuest() bool {
func (self *SZStackGuestDriver) IsSupportedBillingCycle(bc billing.SBillingCycle) bool {
return false
}
func (self *SZStackGuestDriver) IsSupportPostpaidExpire() bool {
return true
}
func (self *SZStackGuestDriver) CancelExpireTime(
ctx context.Context, userCred mcclient.TokenCredential, guest *models.SGuest) error {
return guest.CancelExpireTime(ctx, userCred)
}