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:
parent
4eacdcde99
commit
544039653e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user