'Revert a volume to a snapshot'

def revert_to_snapshot(self, context, volume, snapshot):

    if (self.configuration.lvm_type == 'thin'):
        msg = _('Revert    volume    to    snapshot    not    implemented    for    thin    LVM.')
        raise NotImplementedError(msg)
    else:
        self.vg.revert(self._escape_snapshot(snapshot.name))
        self.vg.deactivate_lv(volume.name)
        self.vg.activate_lv(volume.name)
        self.create_snapshot(snapshot)
