]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Fix volume_create()/snapshot_create() DB methods
authorRoman Podolyaka <rpodolyaka@mirantis.com>
Wed, 24 Jul 2013 13:37:48 +0000 (16:37 +0300)
committerRoman Podolyaka <rpodolyaka@mirantis.com>
Thu, 1 Aug 2013 19:23:06 +0000 (22:23 +0300)
commit24884636dfe7990e3918c7a55a85bba833914349
treede5b4c850523683d8323ee3834568788f20b1cce
parent2f7d2dce0e89ace77a23db834df4dd3f64c360c0
Fix volume_create()/snapshot_create() DB methods

volume_create() and snapshot_create() DB API methods create
entities and return information about them by calling
_volume_get() and snapshot_get() methods. There is no need
to create a new transaction to call the corresponding 'getter'.

Unfortunately, fixing this breaks two existing tests, which rely
on the current behaviour of these DB API methods: both volume_create()
and snapshot_create() raise exceptions, nevertheless new entities are
created.

Blueprint: db-session-cleanup

Change-Id: Idecac70893ec280c149f9227f86a6959d70c15fe
cinder/db/sqlalchemy/api.py
cinder/tests/test_volume.py