fix(region): delete aliyun account bugfix

This commit is contained in:
TangBin
2020-11-20 15:45:10 +08:00
parent 0bbba6d3f8
commit e5289f8a4c
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -2289,7 +2289,7 @@ func (self *SManagedVirtualizationRegionDriver) RequestElasticcacheUpdateBackupP
}
func (self *SManagedVirtualizationRegionDriver) ValidateCreateElasticcacheAccountData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error) {
if name, _ := data.GetString("name");name == "root" {
if name, _ := data.GetString("name"); name == "root" {
return nil, httperrors.NewConflictError("account name 'root' is not allowed")
}
@@ -882,7 +882,8 @@ func (self *SElasticcache) GetSecurityGroupIds() ([]string, error) {
func (self *SElasticcache) GetICloudElasticcacheAccount(accountId string) (cloudprovider.ICloudElasticcacheAccount, error) {
segs := strings.Split(accountId, "/")
if len(segs) < 2 {
return nil, errors.Wrap(fmt.Errorf("%s", accountId), "elasticcache.GetICloudElasticcacheAccount invalid account id ")
log.Debugf("elasticcache.GetICloudElasticcacheAccount invalid account id %s", accountId)
return nil, errors.Wrap(cloudprovider.ErrNotFound, "invalid account id")
}
return self.GetICloudElasticcacheAccountByName(segs[1])