'Deletes a snapshot.'

@cinder_utils.trace
def delete_snapshot(self, snapshot):

    client = self._login()
    try:
        snap_info = client.getSnapshotByName(snapshot['name'])
        client.deleteSnapshot(snap_info['id'])
    except hpeexceptions.HTTPNotFound:
        LOG.error('Snapshot    did    not    exist.    It    will    not    be    deleted')
    except hpeexceptions.HTTPServerError as ex:
        in_use_msg = 'cannot    be    deleted    because    it    is    a    clone    point'
        if (in_use_msg in ex.get_description()):
            raise exception.SnapshotIsBusy(snapshot_name=snapshot['name'])
        raise exception.VolumeBackendAPIException(ex)
    except Exception as ex:
        raise exception.VolumeBackendAPIException(ex)
    finally:
        self._logout(client)
