'Returns the number of ancestral clones of the given volume.'

def _get_clone_depth(self, client, volume_name, depth=0):

    parent_volume = self.rbd.Image(client.ioctx, volume_name)
    try:
        (_pool, parent, _snap) = self._get_clone_info(parent_volume, volume_name)
    finally:
        parent_volume.close()
    if (not parent):
        return depth
    if (depth > self.configuration.rbd_max_clone_depth):
        raise Exception((_('clone    depth    exceeds    limit    of    %s') % self.configuration.rbd_max_clone_depth))
    return self._get_clone_depth(client, parent, (depth + 1))
