diff options
author | Dan Smith <danms@us.ibm.com> | 2013-01-29 18:53:51 -0500 |
---|---|---|
committer | Dan Smith <danms@us.ibm.com> | 2013-02-01 19:11:36 -0500 |
commit | acc30a869fa5b6c231fac713014f60216244672e (patch) | |
tree | c56a1f2d70f10aeb266b65aa4b1f1b53376c43fd /nova/utils.py | |
parent | 77dbed11a6bf95d56e563200d175fe3ada553a6f (diff) | |
download | nova-acc30a869fa5b6c231fac713014f60216244672e.tar.gz nova-acc30a869fa5b6c231fac713014f60216244672e.tar.xz nova-acc30a869fa5b6c231fac713014f60216244672e.zip |
Make system_metadata update in place
This makes the system_metadata updated in-place like regular
metadata during instance_update(). It also modifies that function
to avoid actually removing the item from the list, which will cause it
to be deleted from the database when the session ends. The soft_delete
is sufficient for our purposes.
Related to blueprint no-db-compute
Change-Id: I0da28ec485dc7850d246dab0a2bb95ae10c05c3e
Diffstat (limited to 'nova/utils.py')
-rw-r--r-- | nova/utils.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/utils.py b/nova/utils.py index de9879393..a345d487c 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -1270,5 +1270,6 @@ def last_bytes(file_like_object, num): def metadata_to_dict(metadata): result = {} for item in metadata: - result[item['key']] = item['value'] + if not item.get('deleted'): + result[item['key']] = item['value'] return result |