]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Return updated volume type after updating
authorLisaLi <xiaoyan.li@intel.com>
Thu, 28 Jan 2016 02:47:36 +0000 (10:47 +0800)
committerLisaLi <xiaoyan.li@intel.com>
Mon, 1 Feb 2016 07:52:36 +0000 (07:52 +0000)
commit103ca5e0959f440acf8c9a89eb1c6cc7d42039bc
tree3d700d661e03bf5fe68c1d96662c519b41f6bcd6
parentd3fe19cd3b6ae78c81b4c317c49e8e8d579714b1
Return updated volume type after updating

When updating volume type in db, it queries the object and
would like to return the updated object.

The problem is that the update session hasn't committed and
the update has not been implemented in db. And then the query is
executed in another session. As a result, the update function returns
an non-updated object.

The fix is to return updated object.

Closes-Bug: #1540190

Change-Id: I4b57ea69b1eebd62de707ca15aad32c53fca9f1d
cinder/db/sqlalchemy/api.py
cinder/tests/unit/db/test_volume_type.py [new file with mode: 0644]