Comment 2 for bug 1206561

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

Reviewed: https://review.openstack.org/47984
Committed: http://github.com/openstack/cinder/commit/36fab5ae26579c3cc68ef4ca02bdab3c232ce648
Submitter: Jenkins
Branch: master

commit 36fab5ae26579c3cc68ef4ca02bdab3c232ce648
Author: Roman Podolyaka <email address hidden>
Date: Mon Sep 23 17:58:54 2013 +0300

    Fix finish_volume_migration() on SQLAlchemy 0.8.x

    In SQAlchemy 0.8.x "Unconsumed column names" warning became
    an exception, so refering to a non-existent column in insert()
    or update() call raises an error.

    finish_volume_migration() calls Session.update() method passing
    values of two non-existent columns as arguments (volume_metadata,
    volume_admin_metadata, volume_type). These two are not table columns
    at all, but rather SQLAlchemy models relationships.

    As SQLAlchemy ORM implements Unity of Work pattern, we should not
    really track changes to a model instance manually at all, because
    Session class already does it for us. finish_volume_migration()
    is refactored to take benefit of this fact.

    Fixes bug 1206561

    Change-Id: I4513e3155a7dc6dcbd1c95aa9c14d1e1e5d02ab4