'Destroys ZFS parent objects
Recursively destroys ZFS parent volumes and snapshots if they are
marked as garbage
:param zfs_object: full path to a volume or a snapshot'

def _collect_garbage(self, zfs_object):

    if (zfs_object and (zfs_object in self._needless_objects)):
        sp = zfs_object.split('/')
        path = '/'.join(sp[:(-1)])
        name = sp[(-1)]
        if ('@' in name):
            (volume, snap) = name.split('@')
            parent = '/'.join((path, volume))
            try:
                self.nms.snapshot.destroy(zfs_object, '')
            except exception.NexentaException as exc:
                LOG.debug('Error    occurred    while    trying    to    delete    a    snapshot:    %s', exc)
                return
        else:
            try:
                props = (self.nms.zvol.get_child_props(zfs_object, 'origin') or {})
            except exception.NexentaException:
                props = {}
            parent = (props['origin'] if (('origin' in props) and props['origin']) else '')
            try:
                self.nms.zvol.destroy(zfs_object, '')
            except exception.NexentaException as exc:
                LOG.debug('Error    occurred    while    trying    to    delete    a    volume:    %s', exc)
                return
        self._needless_objects.remove(zfs_object)
        self._collect_garbage(parent)
