If PYTHONHASHSEED is set to a non-zero value,
test_objects.TestObject.test_base_attributes unit test
fails. This is because 'cinder_object.changes' key is
an unsorted list when the object is converted to a
primitive. The following patch fixes this by sorting
cinder_object.changes.
Change-Id: I3a80396c5c897de26e982fa6426e7720a09c1375
Closes-Bug: #
1434154
'cinder_object.version': target_version or self.VERSION,
'cinder_object.data': primitive}
if self.obj_what_changed():
- obj['cinder_object.changes'] = list(self.obj_what_changed())
+ obj['cinder_object.changes'] = sorted(self.obj_what_changed())
return obj
def obj_set_defaults(self, *attrs):
'cinder_object.namespace': 'cinder',
'cinder_object.version': '1.6',
'cinder_object.changes':
- ['deleted', 'created_at', 'deleted_at', 'updated_at'],
+ ['created_at', 'deleted', 'deleted_at', 'updated_at'],
'cinder_object.data':
{'created_at': timeutils.isotime(dt),
'updated_at': timeutils.isotime(dt),