mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
keystone: reword error messages
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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"))
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user