Merge pull request #1294 from swordqiu/hotfix/qj-user-show-system-user-not-found

fix: user-show system user not found
This commit is contained in:
Zexi Li
2019-06-18 23:58:25 +08:00
committed by GitHub
+4
View File
@@ -43,6 +43,7 @@ func init() {
type UserDetailOptions struct {
ID string `help:"ID of user"`
Domain string `help:"Domain"`
System bool `help:"show system user"`
}
R(&UserDetailOptions{}, "user-show", "Show details of user", func(s *mcclient.ClientSession, args *UserDetailOptions) error {
query := jsonutils.NewDict()
@@ -53,6 +54,9 @@ func init() {
}
query.Add(jsonutils.NewString(domainId), "domain_id")
}
if args.System {
query.Add(jsonutils.JSONTrue, "system")
}
user, e := modules.UsersV3.Get(s, args.ID, query)
if e != nil {
return e