novaclient quota-show verb uses the tenant name as the project ID

Bug #1088519 reported by Eoghan Glynn
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-novaclient
Fix Released
Undecided
Eoghan Glynn

Bug Description

novaclient uses the tenant name instead of the tenant ID for the project ID embedded in the os-quota-sets URL.

The result is that the project_usages computed are always zero (unless the tenant magically has the same name as its randomly assigned UUID).

See:

  https://github.com/openstack/python-novaclient/blob/master/novaclient/shell.py#L459

where the Client.__init__() project_id param is set to os_tenant_name.

Revision history for this message
Eoghan Glynn (eglynn) wrote :

Note that the tenant ID would generally be known to the client, from the call out to acquire a token from keystone.

description: updated
Yaguang Tang (heut2008)
Changed in python-novaclient:
status: New → Confirmed
Ivan-Zhu (ivan-zhu)
Changed in python-novaclient:
assignee: nobody → Ivan-Zhu (ivan-zhu)
Ivan-Zhu (ivan-zhu)
Changed in python-novaclient:
assignee: Ivan-Zhu (ivan-zhu) → nobody
Revision history for this message
Eoghan Glynn (eglynn) wrote :

Actually the tenant ID may be opaque to the client, for example when the auth token is cached in the keyring from a previous call out to keystone.

The tenant ID is of course generally embedded in the nova publicURL retrieved from the service catalog, but that is not guaranteed to be the case (i.e. I'm not sure we can safely make assumptions about that URL format).

Eoghan Glynn (eglynn)
summary: - novaclient uses the tenant name as the project ID
+ novaclient quota-show verb uses the tenant name as the project ID
Changed in python-novaclient:
assignee: nobody → Eoghan Glynn (eglynn)
status: Confirmed → In Progress
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/18412

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/18412
Committed: http://github.com/openstack/python-novaclient/commit/e6e22dbe77cbcb9e2078ab8574ebb75575ab2168
Submitter: Jenkins
Branch: master

commit e6e22dbe77cbcb9e2078ab8574ebb75575ab2168
Author: Eoghan Glynn <email address hidden>
Date: Wed Dec 19 20:07:41 2012 +0000

    Make --tenant a required arg for quota-show

    Fixes LP 1088519

    Previously, novaclient was incorrectly defaulting to the tenant name
    as the tenant ID when retrieving quota thresholds via the os-quota-sets
    API extension, in an apparent attempt to default to the current tenant
    if no specific tenant is explicitly requested.

    As a result, the default quotas were always returned, regardless of
    whether there were specific overridden quotas for this tenant.

    We now require that the --tenant option is always specified for the
    quota-show verb, as a sensible default isn't always possible
    (because the tenant ID may be opaque to the client, for example when
    the auth token is cached in the keyring from a previous call out to
    keystone - now the tenant ID is of course generally embedded in the
    nova publicURL retrieved from the service catalog, but that is not
    guaranteed to be the case, i.e. I don't think we can safely make
    assumptions about that URL format).

    This change also makes the quota-show verb more consistent with the
    quota-update verb, which currently requires that the tenant is
    always explicitly specified.

    Change-Id: I1706ad993059e70ca0e2f3bcf7b1d06cbcc39f2d

Changed in python-novaclient:
status: In Progress → Fix Committed
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.