openstack role list: error: unrecognized arguments: --group

Bug #1441010 reported by Sam Wan
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
devstack
Invalid
Undecided
Zhenzan Zhou

Bug Description

# pip list|grep openstackclient
python-openstackclient (1.0.3)

--------------------
2015-04-07 07:21:28.446 | + get_or_add_group_project_role 41cc0bc06345455a931952d67db690ba d978479293c149a9b98120aa10199d9a cd7ab1a5bcb64d69b4e400e6bc4f4f0c
2015-04-07 07:21:28.448 | ++ openstack role list --group d978479293c149a9b98120aa10199d9a --project cd7ab1a5bcb64d69b4e400e6bc4f4f0c --column ID --column Name
2015-04-07 07:21:28.448 | ++ grep ' 41cc0bc06345455a931952d67db690ba '
2015-04-07 07:21:28.448 | ++ get_field 1
2015-04-07 07:21:28.449 | ++ local data field
2015-04-07 07:21:28.449 | ++ read data
2015-04-07 07:21:30.254 | usage: openstack role list [-h] [-f {csv,html,json,table,yaml}] [-c COLUMN]
2015-04-07 07:21:30.255 | [--max-width <integer>]
2015-04-07 07:21:30.255 | [--quote {all,minimal,none,nonnumeric}]
2015-04-07 07:21:30.255 | [--project <project>] [--user <user>]
2015-04-07 07:21:30.255 | openstack role list: error: unrecognized arguments: --group d978479293c149a9b98120aa10199d9a
2015-04-07 07:21:30.354 | + local group_role_id=
2015-04-07 07:21:30.354 | + [[ -z '' ]]
-----------------

Revision history for this message
Sam Wan (sam-wan) wrote :

Seems '--group' is supported on identity v3 but currently devstack deploys identity v2.

https://github.com/openstack/python-openstackclient/blob/master/openstackclient/identity/v3/role.py

gordon chung (chungg)
Changed in devstack:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to devstack (master)

Fix proposed to branch: master
Review: https://review.openstack.org/172553

Changed in devstack:
assignee: nobody → gordon chung (chungg)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on devstack (master)

Change abandoned by gordon chung (<email address hidden>) on branch: master
Review: https://review.openstack.org/172553
Reason: thanks for letting me know Jordan. i'll drop mine for now.

Changed in devstack:
assignee: gordon chung (chungg) → Zhenzan Zhou (zhenzan-zhou)
Revision history for this message
Ryota Mibu (r-mibu) wrote :
Revision history for this message
Accela Zhao (accelazh) wrote :

I'm using devstack stable/kilo (commit 24cc0023), to install Openstack stable/kilo branches, multi-node setup, on Ubuntu 14.04. This is bug occurs when I'm installing the controller node, `openstack role list: error: unrecognized arguments: --group`.

The line of code that raises this error can be found here. The devstack/function-commons::get_or_add_group_project_role tries to access `--group`, but argument unrecognised. (I will talk about `--user` later.)

    https://github.com/openstack-dev/devstack/blob/stable/kilo/functions-common#L777

It looks like here the `openstack` command is using Keystone API v2. But only V3 has the concept "group".

    http://developer.openstack.org/api-ref-identity-admin-v2.html
    http://developer.openstack.org/api-ref-identity-v3.html

Revision history for this message
Accela Zhao (accelazh) wrote :

Reproduce the above error in command line

```
# Check the version of python-openstackclient
$ openstack --version
openstack 1.2.1

# Simulate the environment variable in devstack/function-commons::get_or_add_group_project_role
$ export OS_TOKEN=secrete
$ export OS_URL=http://10.13.183.120:35357/v2.0

# Keystone V2 API doesn't recognize --group
$ openstack role list --group 678642aaec404be0bcc0dcb156c113f5 --project 8a0bdf23a52f423a82b728f3d40b04a4 --column ID --column Name
usage: openstack role list [-h] [-f {csv,html,json,table,yaml}] [-c COLUMN]
                           [--max-width <integer>]
                           [--quote {all,minimal,none,nonnumeric}]
                           [--project <project>] [--user <user>]
openstack role list: error: unrecognized arguments: --group 678642aaec404be0bcc0dcb156c113f5

# Ensure V2 environment variable is cleaned, use V3 API
$ unset OS_URL
$ openstack role list --group 678642aaec404be0bcc0dcb156c113f5 --project 8a0bdf23a52f423a82b728f3d40b04a4 --column ID --column Name --os-identity-api-version=3 --os-url=http://10.13.183.120:5000/v3
+----------------------------------+-------+
| ID | Name |
+----------------------------------+-------+
| d7bc8e55ad214e5d964b6c36d958ff1d | admin |
+----------------------------------+-------+
```

Revision history for this message
Accela Zhao (accelazh) wrote :

I found a similar devstack/functions-common::get_or_create_group, but who explicitly force `openstack` client to use Keystone API V3, by `--os-identity-api-version=3 --os-url=$os_url`. So this function doesn't raise the error like above.

    https://github.com/openstack-dev/devstack/blob/stable/kilo/functions-common#L682

AFAIK, it looks like devstack/function-commons::get_or_add_group_project_role somehow missed these command options to force use Keystone API V3. The "argument --user is required" error looks like to be caused by the same reason. It disappeared after `openstack` client switched to V3 API.

Revision history for this message
Accela Zhao (accelazh) wrote :

I checked devstack master branch (commit 9e220b9b) and found the same issue exists.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to devstack (master)

Fix proposed to branch: master
Review: https://review.openstack.org/183556

Changed in devstack:
assignee: Zhenzan Zhou (zhenzan-zhou) → Accela Zhao (accelazh)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on devstack (master)

Change abandoned by Accela Zhao (<email address hidden>) on branch: master
Review: https://review.openstack.org/183556
Reason: Duplicated patch to https://review.openstack.org/#/c/171979/.

Changed in devstack:
assignee: Accela Zhao (accelazh) → Eli Qiao (taget-9)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Eli Qiao (<email address hidden>) on branch: master
Review: https://review.openstack.org/183965

Changed in devstack:
assignee: Eli Qiao (taget-9) → Zhenzan Zhou (zhenzan-zhou)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Zhenzan Zhou (<email address hidden>) on branch: master
Review: https://review.openstack.org/171979
Reason: Devstack has V3 API enabled.

Revision history for this message
Sean Dague (sdague) wrote :

This devstack bug was last updated over 180 days ago, as devstack
is a fast moving project and we'd like to get the tracker down to
currently actionable bugs, this is getting marked as Invalid. If the
issue still exists, please feel free to reopen it.

Changed in devstack:
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.