'Deletes a volume with the given volume[\'name\'].'

@utils.trace
def delete_volume(self, volume):

    lcfg = self.configuration
    try:
        lun2del = self.zfssa.get_lun(lcfg.zfssa_pool, lcfg.zfssa_project, volume['name'])
    except exception.VolumeNotFound:
        LOG.warning('No    LUN    found    on    ZFSSA    corresponding    to    volume    ID    %s.', volume['id'])
        return
    if (('origin' in lun2del) and ('id' in volume)):
        if lun2del['nodestroy']:
            self.zfssa.set_lun_props(lcfg.zfssa_pool, lcfg.zfssa_project, volume['name'], nodestroy=False)
        tmpsnap = ('tmp-snapshot-%s' % volume['id'])
        if (lun2del['origin']['snapshot'] == tmpsnap):
            self.zfssa.delete_snapshot(lcfg.zfssa_pool, lcfg.zfssa_project, lun2del['origin']['share'], lun2del['origin']['snapshot'])
            return
    self.zfssa.delete_lun(pool=lcfg.zfssa_pool, project=lcfg.zfssa_project, lun=volume['name'])
    if (('origin' in lun2del) and (lun2del['origin']['project'] == lcfg.zfssa_cache_project)):
        self._check_origin(lun2del, volume['name'])
