quota-show and quota-defaults not work because 'SessionClient' object has no attribute 'tenant_id'

Bug #1407388 reported by Rui Chen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-novaclient
Fix Released
Undecided
Rui Chen

Bug Description

stack@devstack:/opt/stack/logs$ $ nova --debug quota-show
DEBUG (shell:908) 'SessionClient' object has no attribute 'tenant_id'
Traceback (most recent call last):
  File "/opt/stack/python-novaclient/novaclient/shell.py", line 905, in main
    OpenStackComputeShell().main(argv)
  File "/opt/stack/python-novaclient/novaclient/shell.py", line 832, in main
    args.func(self.cs, args)
  File "/opt/stack/python-novaclient/novaclient/v1_1/shell.py", line 3872, in do_quota_show
    _quota_show(cs.quotas.get(cs.client.tenant_id, user_id=args.user))
AttributeError: 'SessionClient' object has no attribute 'tenant_id'
ERROR (AttributeError): 'SessionClient' object has no attribute 'tenant_id'

Same issue exist in quota-defaults command.

Rui Chen (kiwik-chenrui)
Changed in python-novaclient:
assignee: nobody → Rui Chen (kiwik-chenrui)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

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

Changed in python-novaclient:
status: New → In Progress
Revision history for this message
Eli Qiao (taget-9) wrote :
Download full text (6.4 KiB)

hi , I can not reproduce this issue

[tagett@stack-01 devstack]$ nova --debug quota-show
REQ: curl -i 'http://cloudcontroller:5000/v2.0/tokens' -X POST -H "Accept: application/json" -H "Content-Type: application/json" -H "User-Agent: python-novaclient" -d '{"auth": {"tenantName": "admin", "passwordCredentials": {"username": "admin", "password": "{SHA1}40bd001563085fc35165329ea1ff5c5ecbdbbeef"}}}'
RESP: [200] {'content-length': '4256', 'vary': 'X-Auth-Token', 'keep-alive': 'timeout=5, max=100', 'server': 'Apache/2.4.10 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.5 Python/2.7.5', 'connection': 'Keep-Alive', 'date': 'Thu, 08 Jan 2015 07:29:18 GMT', 'content-type': 'application/json'}
RESP BODY: {"access": {"token": {"issued_at": "2015-01-08T07:29:18.697659", "expires": "2015-01-08T08:29:18Z", "id": "{SHA1}4f0688a2d95d565cc70ba923dd63aa1585ee544c", "tenant": {"parent_id": null, "enabled": true, "description": null, "name": "admin", "id": "e2737e31f233492b9967075c1e252a8a"}, "audit_ids": ["s_nS9MheTI6pbTxeVcpssA"]}, "serviceCatalog": [{"endpoints_links": [], "endpoints": [{"adminURL": "http://cloudcontroller:8774/v2/e2737e31f233492b9967075c1e252a8a", "region": "RegionOne", "publicURL": "http://cloudcontroller:8774/v2/e2737e31f233492b9967075c1e252a8a", "internalURL": "http://cloudcontroller:8774/v2/e2737e31f233492b9967075c1e252a8a", "id": "0151fdfa39ca473f80b87a66a2854be0"}], "type": "compute", "name": "nova"}, {"endpoints_links": [], "endpoints": [{"adminURL": "http://cloudcontroller:8774/v2.1/e2737e31f233492b9967075c1e252a8a", "region": "RegionOne", "publicURL": "http://cloudcontroller:8774/v2.1/e2737e31f233492b9967075c1e252a8a", "internalURL": "http://cloudcontroller:8774/v2.1/e2737e31f233492b9967075c1e252a8a", "id": "1e02b8c0ffb24157a5f737e2c540d476"}], "type": "computev21", "name": "novav21"}, {"endpoints_links": [], "endpoints": [{"adminURL": "http://cloudcontroller:8776/v2/e2737e31f233492b9967075c1e252a8a", "region": "RegionOne", "publicURL": "http://cloudcontroller:8776/v2/e2737e31f233492b9967075c1e252a8a", "internalURL": "http://cloudcontroller:8776/v2/e2737e31f233492b9967075c1e252a8a", "id": "29541107c37f484bb3c34cb90ebee84c"}], "type": "volumev2", "name": "cinderv2"}, {"endpoints_links": [], "endpoints": [{"adminURL": "http://cloudcontroller:3333", "region": "RegionOne", "publicURL": "http://cloudcontroller:3333", "internalURL": "http://cloudcontroller:3333", "id": "0a53863cb39643b9878aa85174a5aab4"}], "type": "s3", "name": "s3"}, {"endpoints_links": [], "endpoints": [{"adminURL": "http://cloudcontroller:9292", "region": "RegionOne", "publicURL": "http://cloudcontroller:9292", "internalURL": "http://cloudcontroller:9292", "id": "78aa5117f2e4423ea520ec74a880c35d"}], "type": "image", "name": "glance"}, {"endpoints_links": [], "endpoints": [{"adminURL": "http://192.168.1.64:8000/v1", "region": "RegionOne", "publicURL": "http://192.168.1.64:8000/v1", "internalURL": "http://192.168.1.64:8000/v1", "id": "277b8795af4b4e63b98f1bcd0ead52ae"}], "type": "cloudformation", "name": "heat-cfn"}, {"endpoints_links": [], "endpoints": [{"adminURL": "http://cloudcontroller:8776/v1/e2737e31f233492b9967075c1e252a8a", "region": "RegionOne", "publicURL": "http:/...

Read more...

Changed in python-novaclient:
status: In Progress → Incomplete
Revision history for this message
Rui Chen (kiwik-chenrui) wrote :

Hi @Eli, which version of novaclient do you use? more info please

The following is mine

ERROR (AttributeError): 'SessionClient' object has no attribute 'tenant_id'
stack@devstack:/opt/stack/python-novaclient$ [master]$ env | grep OS
OS_REGION_NAME=RegionOne
OS_IDENTITY_API_VERSION=2.0
OS_PASSWORD=Galax8800
OS_AUTH_URL=http://10.250.10.29:5000/v2.0
OS_USERNAME=admin
OS_TENANT_NAME=admin
OS_VOLUME_API_VERSION=2
OS_CACERT=/opt/stack/data/CA/int-ca/ca-chain.pem
OS_NO_CACHE=1
LESSCLOSE=/usr/bin/lesspipe %s %s
stack@devstack:/opt/stack/python-novaclient$ [master]$ git branch -v
  bug/1407388 2d8dc13 Fix issue of quota-show and quota-defaults
* master 71fe9cb Updated from global requirements

Changed in python-novaclient:
status: Incomplete → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/144866
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=4e76f9590b49c925703cbbf42d1e232725465eff
Submitter: Jenkins
Branch: master

commit 4e76f9590b49c925703cbbf42d1e232725465eff
Author: Rui Chen <email address hidden>
Date: Sun Jan 4 16:35:12 2015 +0800

    Fix issue of quota-show and quota-defaults

    quota-show and quota-defaults not work because 'SessionClient'
    object has no attribute 'tenant_id'. Try to get project_id
    from auth_ref when cs.client is SessionClient instance.

    Change-Id: Ic125a99ba34e911485868454c3c7531a34eabdc9
    Closes-Bug: #1407388

Changed in python-novaclient:
status: In Progress → Fix Committed
Michael Still (mikal)
Changed in python-novaclient:
milestone: none → 2.21.0
Michael Still (mikal)
Changed in python-novaclient:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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