

def _save_flavor(self, context):
    if (not any([(x in self.obj_what_changed()) for x in ('flavor', 'old_flavor', 'new_flavor')])):
        return
    flavor_info = {
        'cur': self.flavor.obj_to_primitive(),
        'old': ((self.old_flavor and self.old_flavor.obj_to_primitive()) or None),
        'new': ((self.new_flavor and self.new_flavor.obj_to_primitive()) or None),
    }
    db.instance_extra_update_by_uuid(context, self.uuid, {
        'flavor': jsonutils.dumps(flavor_info),
    })
    self.obj_reset_changes(['flavor', 'old_flavor', 'new_flavor'])

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/objects/instance.py Instance._save_flavor/original