diff --git a/pkg/multicloud/aliyun/elasticcache_instance.go b/pkg/multicloud/aliyun/elasticcache_instance.go index 6c52b5f8ee..c071b1aa25 100644 --- a/pkg/multicloud/aliyun/elasticcache_instance.go +++ b/pkg/multicloud/aliyun/elasticcache_instance.go @@ -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 { diff --git a/pkg/multicloud/huawei/elasticcache_instance.go b/pkg/multicloud/huawei/elasticcache_instance.go index a0b7630611..a1e697c276 100644 --- a/pkg/multicloud/huawei/elasticcache_instance.go +++ b/pkg/multicloud/huawei/elasticcache_instance.go @@ -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"))