Introduction of Objects breaks a number of assumptions

Bug #1427851 reported by John Griffith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
John Griffith

Bug Description

Prior to Cinder Objects we passed a dictionary representation of a Cinder resource around. There are a few places where we abuse this a bit and do things like "refdict.get('some-key', None) to reuse some code and determine if for example the object is a snapshot or a volume (based on it's keys). This is probably a pretty lazy/bad idea, but we have cases where we do it, such as in the SolidFire driver and it looks like maybe some calls in the profiler.

For now, we just make the compat shim in Object base truly compatible and return None for non-existent attributes rather than raising. Follow up work would be to clean up all of our usage to strictly use objects and get rid of the compatibility shim altogether.

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/160987

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

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

commit e8d18a8714674c4f494ed7c8089fbf11b751d7aa
Author: John Griffith <email address hidden>
Date: Tue Mar 3 21:27:27 2015 +0000

    Make objects behave more like our old dictionaries

    Prior to Cinder Objects we passed a dictionary representation
    of a Cinder resource around. There are a few places where we
    abuse this a bit and do things like "ref_dict.get('some-key', None)"
    to reuse some code and determine if for example the object is
    a snapshot or a volume (based on it's keys). This is probably
    a pretty lazy/bad idea, but we have cases where we do it,
    such as in the SolidFire driver and it looks like maybe some
    calls in the profiler.

    For now, we just make the compatibility shim in Object base truly
    compatible and return None for non-existent attributes rather
    than raising. Follow up work would be to clean up all of our
    usage to strictly use objects and get rid of the compatibility
    shim altogether.

    Change-Id: Ia640c912700d9569c6b522b77fc357fb026269b1
    Closes-Bug: #1427851

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