summaryrefslogtreecommitdiffstats
path: root/nova/objects
diff options
context:
space:
mode:
authorChris Behrens <cbehrens@codestud.com>2013-06-17 19:10:10 +0000
committerChris Behrens <cbehrens@codestud.com>2013-06-17 19:12:23 +0000
commit1b9961c4b6785d85e98223f576bd839c0212b3a7 (patch)
tree3a3495567fcccb8daf67d51fc06c4194df5fb1ca /nova/objects
parent328b347cd058f1c87d7e32a18d9decc0ba517266 (diff)
Fix instance obj refresh()
The refresh() method pulls a fresh copy of the instance but if any fields changed when doing so, they are left marked as changes that are not yet committed. Also clarified the doc string for obj_what_changed() to state that a set is returned, not a list. This method is not used yet, so I didn't file a bug for this. Change-Id: I83fbce07936fea2bc936441c5c6594f65da443a7
Diffstat (limited to 'nova/objects')
-rw-r--r--nova/objects/base.py2
-rw-r--r--nova/objects/instance.py1
2 files changed, 2 insertions, 1 deletions
diff --git a/nova/objects/base.py b/nova/objects/base.py
index 2e0797477..ec1ada6aa 100644
--- a/nova/objects/base.py
+++ b/nova/objects/base.py
@@ -311,7 +311,7 @@ class NovaObject(object):
raise NotImplementedError('Cannot save anything in the base class')
def obj_what_changed(self):
- """Returns a list of fields that have been modified."""
+ """Returns a set of fields that have been modified."""
return self._changed_fields
def obj_reset_changes(self, fields=None):
diff --git a/nova/objects/instance.py b/nova/objects/instance.py
index aec6fe968..cd08c4c4f 100644
--- a/nova/objects/instance.py
+++ b/nova/objects/instance.py
@@ -256,6 +256,7 @@ class Instance(base.NovaObject):
if (hasattr(self, base.get_attrname(field)) and
self[field] != current[field]):
self[field] = current[field]
+ self.obj_reset_changes()
def obj_load_attr(self, attrname):
extra = []