Merge pull request #3837 from tb365/bugfix/tb-bugfix-112101

redis prepaid instance create bugfix
This commit is contained in:
yunion-ci-robot
2019-11-22 22:14:27 +08:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
@@ -626,7 +626,7 @@ func (self *SRegion) CreateIElasticcaches(ec *cloudprovider.SCloudElasticCacheIn
params["VpcId"] = ec.VpcId
params["VSwitchId"] = ec.NetworkId
params["ChargeType"] = ec.ChargeType
if ec.ChargeType == billing.BILLING_TYPE_PREPAID && ec.BC != nil {
if strings.ToLower(ec.ChargeType) == billing.BILLING_TYPE_PREPAID && ec.BC != nil {
if ec.BC.GetMonths() >= 1 && ec.BC.GetMonths() <= 9 {
params["Period"] = strconv.Itoa(ec.BC.GetMonths())
} else if ec.BC.GetMonths() == 12 || ec.BC.GetMonths() == 24 || ec.BC.GetMonths() == 36 {
@@ -468,7 +468,7 @@ func (self *SRegion) CreateIElasticcaches(ec *cloudprovider.SCloudElasticCacheIn
params.Set("maintain_end", jsonutils.NewString(ec.MaintainEnd))
}
if ec.ChargeType == billing_api.BILLING_TYPE_PREPAID && ec.BC != nil {
if strings.ToLower(ec.ChargeType) == billing_api.BILLING_TYPE_PREPAID && ec.BC != nil {
bssParam := jsonutils.NewDict()
bssParam.Set("charging_mode", jsonutils.NewString("prePaid"))
bssParam.Set("is_auto_pay", jsonutils.NewString("true"))