keystone: reword error messages

This commit is contained in:
Yousong Zhou
2021-01-11 15:52:51 +08:00
parent eb84a308af
commit a71c875470
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ func (manager *SCredentialManager) InitializeData() error {
func (manager *SCredentialManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error) {
if !data.Contains("type") {
return nil, httperrors.NewInputParameterError("missing input feild type")
return nil, httperrors.NewInputParameterError("missing input field type")
}
projectId, _ := data.GetString("project_id")
userId := ownerId.GetUserId()
+1 -1
View File
@@ -286,7 +286,7 @@ func (domain *SDomain) ValidatePurgeCondition(ctx context.Context) error {
}
groupCnt, _ := domain.GetGroupCount()
if groupCnt > 0 {
return httperrors.NewInvalidStatusError("group is in use by group")
return httperrors.NewInvalidStatusError("domain is in use by group")
}
projCnt, _ := domain.GetProjectCount()
if projCnt > 0 {
+1 -1
View File
@@ -344,7 +344,7 @@ func (ident *SIdentityProvider) PerformConfig(ctx context.Context, userCred mccl
action := input.Action
changed, err := saveConfigs(userCred, action, ident, opts, nil, nil, api.SensitiveDomainConfigMap)
if err != nil {
return nil, httperrors.NewInternalServerError("saveConfig fail %s", err)
return nil, httperrors.NewInternalServerError("saveConfigs fail %s", err)
}
if changed {
ident.MarkDisconnected(ctx, userCred, fmt.Errorf("change config"))
+1 -1
View File
@@ -207,7 +207,7 @@ func (service *SService) PerformConfig(ctx context.Context, userCred mcclient.To
changed, err = saveConfigs(userCred, action, service, opts, nil, api.MergeServiceConfigOptions(api.CommonWhitelistOptionMap, api.ServiceBlacklistOptionMap), nil)
}
if err != nil {
return nil, httperrors.NewInternalServerError("saveConfig fail %s", err)
return nil, httperrors.NewInternalServerError("saveConfigs fail %s", err)
}
if changed {
diff := SService{ConfigVersion: 1}