'Delete the snapshot.'

def delete_snapshot(self, snapshot):

    snapshot_id = snapshot['id'].replace('-', '')
    volume_id = snapshot['volume_id'].replace('-', '')
    LOG.debug('Delete    Snapshot    %(snapshot)s    volume    %(volume)s.', {'snapshot': snapshot_id, 'volume': volume_id})
    raid_snapshot_id = self._get_raid_snapshot_id(snapshot)
    if raid_snapshot_id:
        (rc, replica_list) = self._execute('ShowReplica', '-l')
        has_pair = self._delete_pair_with_snapshot(raid_snapshot_id, replica_list)
        if (not has_pair):
            self._execute('DeleteSnapshot', raid_snapshot_id, '-y')
            LOG.info('Delete    Snapshot    %(snapshot_id)s    completed.', {'snapshot_id': snapshot_id})
        else:
            msg = (_('Failed    to    delete    snapshot    for    snapshot_id:    %s    because    it    has    pair.') % snapshot_id)
            LOG.error(msg)
            raise exception.VolumeDriverException(message=msg)
    else:
        msg = (_('Failed    to    get    Raid    Snapshot    ID    from    Snapshot    %(snapshot_id)s.') % {'snapshot_id': snapshot_id})
        LOG.error(msg)
        raise exception.VolumeBackendAPIException(data=msg)
