cinder only supports deriving a user and project id from auth context

Bug #1641982 reported by Steve Martinelli
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
New
Undecided
Unassigned
python-cinderclient
Fix Committed
Undecided
Rajat Dhasmana
python-openstackclient
New
Undecided
Unassigned

Bug Description

In the python bindings for creating a volume there are arguments for specifying a user_id and project_id [1], this exists for many resources (volumes and consistency groups).

        :param user_id: User id derived from context
        :param project_id: Project id derived from context

These are then added to the request body. However, as the docstring indicates, it seems cinder API will never make use of these values. The user_id and project_id is always derived from the auth context [2]. Additionally, the cinder CLI also does not provide a user id or project id to make use of these arguments.

* Why supply these arguments in cinderclient if they are never used?

* Was there ever a plan to allow an admin to create a volume (or cinder resource) for someone else? As it stands now, that would not be possible.

[1] https://github.com/openstack/python-cinderclient/blob/master/cinderclient/v3/volumes.py#L239-L240

[2] https://github.com/openstack/cinder/blob/a15459a27777e98599d70392191b0a6f0288ff34/cinder/context.py#L118

Revision history for this message
Steve Martinelli (stevemar) wrote :

Adding OSC since we (incorrectly) assumed that the user_id and project_id arguments were being used.

Revision history for this message
John Griffith (john-griffith) wrote :

I think there was a time when there was some consideration for doing something like in fact admin or special volumes being created. That never really happened, so we don't need to worry about that.

The only other place that I can think of that might have had some intent here was some of the nested tenant stuff (tenant groups etc) but again the way it is right now wouldn't be much use for that either. Seems to me that these can be removed.

Revision history for this message
Steven Pisarski (spisarski) wrote :

I've encountered the same problem using the cinder v2 & v3 with the Python APIs found in python-cinderclient currently on v 3.2.0.

Changed in python-cinderclient:
assignee: nobody → Rajat Dhasmana (whoami-rajat)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-cinderclient (master)

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

Changed in python-cinderclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-cinderclient (master)

Change abandoned by Rajat Dhasmana (<email address hidden>) on branch: master
Review: https://review.openstack.org/585128
Reason: Patch already merged

https://review.openstack.org/#/c/573622/2

Revision history for this message
Rajat Dhasmana (whoami-rajat) wrote :
Changed in python-cinderclient:
status: In Progress → Fix Committed
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.