KeyError in update_migrated_volume

Bug #1491210 reported by Lisa Li
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Lisa Li

Bug Description

KeyError found:

^[[01;31m2015-09-02 02:11:59.571 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m File "/opt/stack/cinder/cinder/volume/drivers/lvm.py", line 360, in update_migrated_volume^M
^[[01;31m2015-09-02 02:11:59.571 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m 'for volume: %s'), volume['name'])^M
^[[01;31m2015-09-02 02:11:59.571 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00mKeyError: 'name'^M
^[[01;31m2015-09-02 02:11:59.571 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m^M

The reason is that through RPC call, the volume in manager.py update_migrated_volume is dict object, just contains the key-values from db. To get volume['name'] fails as KeyError.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

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

Reviewed: https://review.openstack.org/219566
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=647cff38fe412d2a31c6ed3f77cc1da1e73a8424
Submitter: Jenkins
Branch: master

commit 647cff38fe412d2a31c6ed3f77cc1da1e73a8424
Author: lisali <email address hidden>
Date: Sun Sep 6 06:05:22 2015 +0000

    Retrieve volume in update_migrated_volume

    When transferring db volume module through RPC call, it becomes
    dict objects during RPC call. The attributes/properties
    of the type can't be used.
    As a result, to get volume['name'] raises KeyError.

    The issue is fixed by retrieving volume from db.
    Using volume version object will fix everything but it is
    too late in Liberty. To keep code consistency, db.get_volume
    is used in the fix.

    Change-Id: I5ac7f083d5b4b7490347069728eb4b938c20885c
    Closes-bug: 1491210

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → liberty-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: liberty-rc1 → 7.0.0
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.