Ask Your Question

Revision history [back]

Use roleid for role, rolename won't work

Use roleid for role, rolename won't workThere are couple of problems:

1) 2 ) Openstack command will use get_role_by_rolename and there is no such api, so use role id

There are couple of problems:problems, all of them are due to admintoken. Certain api calls try to get user's domain_id from the token and since you using admin token, they are going to fail.

1) 2 ) Openstack client command is trying to be smart. It doesn't know whether the user has given "id" or "name". It assumes the input as "id" and if it fails assumes it as "name". If both fails errors out.

Your Openstack command will use get_role_by_rolename and does the following

1)   Get domain by domain_id using the domain_id default . This will work
2)   Get user by user_id using user_id as "admin". This won't work. So it will once again try to list all the users and filter by name where name is "admin".  Most probably you are getting 401 here
3 ) Next it will try to do  get_role_by_role_id with id as "rolename" and this  fail. Next it will try  list_roles and try to filter the role name and this will also fails since there is no such api, so api

So your options are  to use role id 

Id for username and rolename

There are couple of problems, all of them are due to admintoken. Certain api calls try to get user's domain_id from the token and since you using admin token, they are going to fail.

Openstack client command is trying to be smart. It doesn't know whether the user has given "id" or "name". It assumes the input as "id" and if it fails assumes it as "name". If both fails errors out.

Your Openstack command does the following

1)   Get domain by domain_id using the domain_id default . This will work
2)   Get user by user_id using user_id as "admin". This won't work. So it will once again try to list all the users and filter by name where name is "admin".  Most probably you are getting 401 here
3 ) Next it will try to do  get_role_by_role_id with id as "rolename" and this  fail. Next it will try  list_roles and try to filter the role name and this will also fails since there is no such api

So your options are  to use  Id for username and rolename