bdcce8b8ad
Minor formatting improvements found during the document check are also done. Change-Id: I55d582100c40961a5b0f5ec4b2ea9a55f2d8d8a1
977 B
977 B
Examples
IOT lightbulb
Note
Full source located at iot_bulb
.
../../../oslo_versionedobjects/examples/iot_bulb.py
Expected (or similar) output:
The __str__() output of this new object: IOTLightbulb(manufactured_on=2017-03-15T23:25:01Z,serial='abc-123')
The 'serial' field of the object: abc-123
Primitive representation of this object: {'versioned_object.version': '1.0', 'versioned_object.changes': ['serial', 'manufactured_on'], 'versioned_object.name': 'IOTLightbulb', 'versioned_object.data': {'serial': u'abc-123', 'manufactured_on': '2017-03-15T23:25:01Z'}, 'versioned_object.namespace': 'versionedobjects.examples'}
The __str__() output of this new (reconstructed) object: IOTLightbulb(manufactured_on=2017-03-15T23:25:01Z,serial='abc-123')
After serial number change, the set of fields that have been mutated is: set(['serial'])