Objects: use setattr rather than dict syntax in remotable

The NovaObjectDictCompat mixin was created with the idea of phasing out
the use of dict compatibility in objects.  In order to achieve that the
base wrapper methods can't use dict style access on objects.  This
converts the dict style accesses in the remotable wrapper to use setattr
instead.

Change-Id: I156532b3c7e00877529cfbaac265de6bb4e1a2dc
This commit is contained in:
Andrew Laski 2015-03-12 16:34:39 -04:00
parent 4eacdcde99
commit 544039653e
1 changed files with 3 additions and 2 deletions

View File

@ -197,9 +197,10 @@ def remotable(fn):
# deserialized any object fields into objects already,
# we do not try to deserialize them again here.
if isinstance(value, NovaObject):
self[key] = value
setattr(self, key, value)
else:
self[key] = field.from_primitive(self, key, value)
setattr(self, key,
field.from_primitive(self, key, value))
self.obj_reset_changes()
self._changed_fields = set(updates.get('obj_what_changed', []))
return result