feat(region): allow to update account with provider vmware

This commit is contained in:
rainzm
2021-04-12 15:56:42 +08:00
parent fc62085cf9
commit 12d1aa805d
3 changed files with 32 additions and 1 deletions
+3 -1
View File
@@ -713,8 +713,10 @@ func (self *SCloudaccount) PerformUpdateCredential(ctx context.Context, userCred
if err != nil {
return nil, httperrors.NewInputParameterError("invalid cloud account info error: %s", err.Error())
}
isEqual := providerDriver.GetAccountIdEqualizer()
// for backward compatibility
if len(self.AccountId) > 0 && accountId != self.AccountId {
if !isEqual(self.AccountId, accountId) {
return nil, httperrors.NewConflictError("inconsistent account_id, previous '%s' and now '%s'", self.AccountId, accountId)
}