feature(keystone): user add language attribute

User add language attribute, notify and alarm will use this attribute to
send message in proper language
This commit is contained in:
Qiu Jian
2020-12-19 09:18:17 +08:00
parent 15e1058519
commit 5cf5576e09
12 changed files with 54 additions and 61 deletions
+11
View File
@@ -174,6 +174,8 @@ func init() {
IdpId string `help:"Id of identity provider to link with"`
IdpEntityId string `help:"Entity id of identity provider to link with"`
Lang string `help:"user default language"`
}
R(&UserCreateOptions{}, "user-create", "Create a user", func(s *mcclient.ClientSession, args *UserCreateOptions) error {
params := jsonutils.NewDict()
@@ -224,6 +226,10 @@ func init() {
params.Add(jsonutils.NewString(args.IdpEntityId), "idp_entity_id")
}
if len(args.Lang) > 0 {
params.Add(jsonutils.NewString(args.Lang), "lang")
}
/*if len(args.DefaultProject) > 0 {
projId, err := modules.Projects.GetId(s, args.DefaultProject, nil)
if err != nil {
@@ -265,6 +271,8 @@ func init() {
// Option []string `help:"User options"`
SkipPasswordComplexityCheck bool `help:"skip_password_complexity_check"`
Lang string `help:"update user language"`
}
R(&UserUpdateOptions{}, "user-update", "Update a user", func(s *mcclient.ClientSession, args *UserUpdateOptions) error {
query := jsonutils.NewDict()
@@ -321,6 +329,9 @@ func init() {
} else if args.DisableMfa {
params.Add(jsonutils.JSONFalse, "enable_mfa")
}
if len(args.Lang) > 0 {
params.Add(jsonutils.NewString(args.Lang), "lang")
}
// if len(args.DefaultProject) > 0 {
// projId, err := modules.Projects.GetId(s, args.DefaultProject, nil)
// if err != nil {