cinder get volume (v3 cinder api) returns wrong attachment id

Bug #1713082 reported by Steve Noyes on 2017-08-25
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-cinderclient
Undecided
Steve Noyes

Bug Description

Using the new attachment cinder v3 api, creating a new attachment creates an attachment object with a unique is. However, when you do a '$ cinder show volume', the attachment od that appears in the output shows that attachment id == the volume_id.

In cinderclient.v2.shell.py._translate_attachments, the attachment_id is replaced with attachment['id'] which happens to be the volume id. That 'id'==vol_id is there for legacy purposes.

This is what the attachment dict looks like in _translate_attachments:

{u'server_id': u'ad6ec786-c1f6-4dc4-ae93-44a05201b765', u'attachment_id': u'92676049-377f-412b-9d98-7cbd4426b4c3', u'attached_at': u'2017-08-24T13:43:05.000000', u'host_name': u'ub16-dstack-ctl1', u'volume_id': u'6518bd6a-eed6-46f8-b66b-fd62270b1f5d', u'device': u'na', u'id': u'6518bd6a-eed6-46f8-b66b-fd62270b1f5d'}

translate_attachment should be using attachment_id, not id, for the returned attachment_id shown in the volume.

Changed in python-cinderclient:
assignee: nobody → Steve Noyes (steve-noyes)
Changed in python-cinderclient:
status: New → In Progress

Reviewed: https://review.openstack.org/498055
Committed: https://git.openstack.org/cgit/openstack/python-cinderclient/commit/?id=aab7a587b6a10a964ca79d7e81a4563a143fcf12
Submitter: Jenkins
Branch: master

commit aab7a587b6a10a964ca79d7e81a4563a143fcf12
Author: Steve Noyes <email address hidden>
Date: Fri Aug 25 14:23:18 2017 -0400

    Fix attachment_id returned by create and show volume

    The attachment_ids in the volume info returned by show volume
    were incorrect. It was showing the volume_id, not the actual
    attachment_id. This fix changes the attachment_ids returned by show
    volume to correctly reflect the attachment_id.

    Also, added a unit test for this, and added an attachment_id
    to the fake volume so that other tests wouldn't now fail.

    Closes-Bug: #1713082
    Change-Id: I9ec36af5dd460d03d786aeeb3cc36a869c19ff62

Changed in python-cinderclient:
status: In Progress → Fix Released

This issue was fixed in the openstack/python-cinderclient 3.2.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers