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.
Reviewed: https:/ /review. openstack. org/47984 github. com/openstack/ cinder/ commit/ 36fab5ae26579c3 cc68ef4ca02bdab 3c232ce648
Committed: http://
Submitter: Jenkins
Branch: master
commit 36fab5ae26579c3 cc68ef4ca02bdab 3c232ce648
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 admin_metadata, volume_type). These two are not table columns
values of two non-existent columns as arguments (volume_metadata,
volume_
at all, but rather SQLAlchemy models relationships.
As SQLAlchemy ORM implements Unity of Work pattern, we should not volume_ migration( )
really track changes to a model instance manually at all, because
Session class already does it for us. finish_
is refactored to take benefit of this fact.
Fixes bug 1206561
Change-Id: I4513e3155a7dc6 dcbd1c95aa9c14d 1e1e5d02ab4