[openstack-dev] [Fuel] Disable observing modifications of nested fields for MutableDict and MutableList

Bulat Gaifullin bgaifullin at mirantis.com
Wed Mar 9 12:38:44 UTC 2016


Fuelers, please notice that the patch [1]  changes behaviour of MutableDict and MutableList.
observing of changes in nested objects has been disabled, because it is not trivial to handle this case properly.
It is much easier to notify about changes in nester fields  explicitly when it is needed.
Example:

# instance.roles_metadata is instance of MutableDict.
instance.roles_metadata[role['name']] = role['meta']
instance.volumes_metadata['volumes_roles_mapping'][role['name']] = role.get('volumes_roles_mapping', [])
# notify about changes
instance.volumes_metadata.changed()

[1]  https://review.openstack.org/#/c/289600/

PS:
  Added missing link

Regards,
Bulat Gaifullin
Mirantis Inc.




More information about the OpenStack-dev mailing list