Openstack的keystone的user-role-list命令的使用

直接在shell模式下执行

[root@node-5 ~]# keystone user-role-list
WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
'Client' object has no attribute 'auth_tenant_id'

执行

[root@node-5 ~]# keystone help user-role-list
usage: keystone user-role-list [--user <user>] [--tenant <tenant>]

List roles granted to a user

Arguments:
  --user <user>, --user-id <user>
                        List roles granted to a user
  --tenant <tenant>, --tenant-id <tenant>
                        List roles granted on a tenant

表示需要提供用户ID,租户ID,最终得到的是一个用户在一个项目中的角色列表。

[root@node-5 ~]# keystone user-role-list --user-id 0be5b5d8a7334b0797ba38d017b4779c --tenant-id 6afef8e2e5db4074b1a445f7563345ba 
WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
+----------------------------------+--------+----------------------------------+----------------------------------+
|                id                |  name  |             user_id              |            tenant_id             |
+----------------------------------+--------+----------------------------------+----------------------------------+
| 2262da376eb549a6a8ffcde6920c1a67 | Member | 0be5b5d8a7334b0797ba38d017b4779c | 6afef8e2e5db4074b1a445f7563345ba |
| 975b2c24fa53461f97ef1186e55b6ecf | admin  | 0be5b5d8a7334b0797ba38d017b4779c | 6afef8e2e5db4074b1a445f7563345ba |
+----------------------------------+--------+----------------------------------+----------------------------------+
原文地址:https://www.cnblogs.com/CLTANG/p/4332212.html