diff options
author | Dan Smith <danms@us.ibm.com> | 2013-01-07 14:17:07 -0500 |
---|---|---|
committer | Chris Behrens <cbehrens@codestud.com> | 2013-01-08 18:14:31 +0000 |
commit | 321a8396ca6e0a6896658e9ceb724f1ba796ee40 (patch) | |
tree | 5285e7f0518f9fabd9cef9fc06947970b79b6bd6 /nova/exception.py | |
parent | 7da89a7947fd2613b3425fa1ded104878b78bda9 (diff) | |
download | nova-321a8396ca6e0a6896658e9ceb724f1ba796ee40.tar.gz nova-321a8396ca6e0a6896658e9ceb724f1ba796ee40.tar.xz nova-321a8396ca6e0a6896658e9ceb724f1ba796ee40.zip |
Refresh instance metadata in-place
For some reason that isn't entirely clear to me, the attempt to update
instance metadata in _instance_update() results in a stale sqlalchemy
object state. This is a similar issue to the one fixed in commit:
9fdf7552779d518af9cda4e366bf81fddb0cb6f2
For some reason, session.refresh() doesn't work for instance['metadata']
in the same way, which also raises suspicion that perhaps it's not the
right fix for system_metadata either.
This patch adds an _instance_update_metadata_in_place() method that
updates the actual instance['metadata'] list _and_ the database,
mirroring the high-level behavior of instance_metadata_update(), but
without requiring us to refresh or re-fetch the metadata or the
whole instance (as a workaround).
Fixes bug 1096653
Change-Id: Ic5a205631b1b7dce3744960ed4201dcc7b4b2ae6
Diffstat (limited to 'nova/exception.py')
0 files changed, 0 insertions, 0 deletions