Bug 1461093

Summary: A bug of unable to filter 'openstack volume list' by --project option
Product: Red Hat OpenStack Reporter: ByoungHee Lee <bylee>
Component: python-openstackclientAssignee: Julie Pichon <jpichon>
Status: CLOSED NEXTRELEASE QA Contact: Shai Revivo <srevivo>
Severity: high Docs Contact:
Priority: unspecified    
Version: 10.0 (Newton)CC: apevec, jpichon, lhh, srevivo
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-16 09:06:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description ByoungHee Lee 2017-06-13 13:44:29 UTC
Description of problem:
There is a bug that unable to filter 'openstack volume list' by —project option in Newton(OSP10). 
I found it fixed in the Ocata(OSP11). 
Is it possible to upgrade only openstack client to the newest version without major upgrade?

Version-Release number of selected component (if applicable):
RHEL OSP 10 (Newton)
OpenStack client version is 3.2.1

How reproducible:
This occurs consistently

Steps to Reproduce:
1. Source overcloudrc for admin account and admin tenant
2. Use the CLI to list volumes for each tenant
  ex) openstack volume list --project=demo
      openstack volume list --project=a_department

Actual results:
It shows only admin volumes

Expected results:
It should list the volume for each tenant by using --project option with admin in Newton(OSP11).

Additional info:

1. results in OSP11
[stack@director-osp11 ~]$ cat overcloudrc
# Clear any old environment that may conflict.
for key in $( set | awk '{FS="="}  /^OS_/ {print $1}' ); do unset $key ; done
export OS_USERNAME=admin
export NOVA_VERSION=1.1
export OS_PROJECT_NAME=admin
export OS_PASSWORD=dzA6XF69rHjkt2G3vveUe3FbM
export OS_NO_CACHE=True
export COMPUTE_API_VERSION=1.1
export no_proxy=,192.168.15.21,172.20.23.34
export OS_CLOUDNAME=overcloud
export OS_AUTH_URL=http://192.168.15.21:5000/v2.0
export OS_AUTH_TYPE=password
export PYTHONWARNINGS="ignore:Certificate has no, ignore:A true SSLContext object is not available"
[stack@director-osp11 ~]$ source overcloudrc
[stack@director-osp11 ~]$ openstack volume list --project admin
+--------------------------------------+--------------+-----------+------+-------------+
| ID                                   | Display Name | Status    | Size | Attached to |
+--------------------------------------+--------------+-----------+------+-------------+
| d42f9f47-d361-4c07-895d-a8db25a83e04 | admin-vol-1G | available |    1 |             |
+--------------------------------------+--------------+-----------+------+-------------+
[stack@director-osp11 ~]$ openstack volume list --project a-department
+--------------------------------------+---------------------+-----------+------+-------------+
| ID                                   | Display Name        | Status    | Size | Attached to |
+--------------------------------------+---------------------+-----------+------+-------------+
| e561d7d7-fddf-4d2c-bc2c-53827f742e8c | a-department-vol-1G | available |    1 |             |
+--------------------------------------+---------------------+-----------+------+-------------+

2. results in OSP10
[stack@director-osp10 ~]$ cat overcloudrc
[stack@director-osp10 ~]$ source overcloudrc
[stack@director-osp10 ~]$ openstack volume list --project admin
+--------------------------------------+--------------+-----------+------+-------------+
| ID                                   | Display Name | Status    | Size | Attached to |
+--------------------------------------+--------------+-----------+------+-------------+
| d42f9f47-d361-4c07-895d-a8db25a83e04 | admin-vol-1G | available |    1 |             |
+--------------------------------------+--------------+-----------+------+-------------+
[stack@director-osp10 ~]$ openstack volume list --project a-department
+--------------------------------------+--------------+-----------+------+-------------+
| ID                                   | Display Name | Status    | Size | Attached to |
+--------------------------------------+--------------+-----------+------+-------------+
| d42f9f47-d361-4c07-895d-a8db25a83e04 | admin-vol-1G | available |    1 |             |
+--------------------------------------+--------------+-----------+------+-------------+

Comment 1 Julie Pichon 2017-06-14 10:42:49 UTC
There is a workaround of using the cinder CLI directly with the project_id:

$ cinder list --tenant <project_id>

I think it's possible to install and use a more recent client on a workstation, however on a server it would likely bring in new dependencies and not be recommended.

Comment 2 ByoungHee Lee 2017-06-16 00:25:58 UTC
This workaround is that I wanted. 
Thanks a lot. Julie

Comment 3 Julie Pichon 2017-06-16 09:06:44 UTC
Thank you for the reply. Workaround deemed sufficient, closing based on comment 2.