def get_minimum_version_all_cells(context, binaries, require_all=False):
    "Get the minimum service version, checking all cells.\n\n    This attempts to calculate the minimum service version for a set\n    of binaries across all the cells in the system. If require_all\n    is False, then any cells that fail to report a version will be\n    ignored (assuming they won't be candidates for scheduling and thus\n    excluding them from the minimum version calculation is reasonable).\n    If require_all is True, then a failing cell will cause this to raise\n    exception.CellTimeout, as would be appropriate for gating some\n    data migration until everything is new enough.\n\n    Note that services that do not report a positive version are excluded\n    from this, as it crosses all cells which will naturally not have all\n    services.\n    "
    if (not all((binary.startswith('nova-') for binary in binaries))):
        LOG.warning("get_minimum_version_all_cells called with likely-incorrect binaries `%s'", ','.join(binaries))
        raise exception.ObjectActionError(action='get_minimum_version_all_cells', reason='Invalid binary prefix')
    results = nova_context.scatter_gather_all_cells(context, Service._db_service_get_minimum_version, binaries)
    min_version = None
    for (cell_uuid, result) in results.items():
        if (result is nova_context.did_not_respond_sentinel):
            LOG.warning('Cell %s did not respond when getting minimum service version', cell_uuid)
            if require_all:
                raise exception.CellTimeout()
        elif (result is nova_context.raised_exception_sentinel):
            LOG.warning('Failed to get minimum service version for cell %s', cell_uuid)
            if require_all:
                raise exception.CellTimeout()
        else:
            relevant_versions = [version for version in result.values() if version]
            if relevant_versions:
                min_version_cell = min(relevant_versions)
                min_version = (min(min_version, min_version_cell) if min_version else min_version_cell)
    return (min_version or 0)
Get the minimum service version, checking all cells.

This attempts to calculate the minimum service version for a set
of binaries across all the cells in the system. If require_all
is False, then any cells that fail to report a version will be
ignored (assuming they won't be candidates for scheduling and thus
excluding them from the minimum version calculation is reasonable).
If require_all is True, then a failing cell will cause this to raise
exception.CellTimeout, as would be appropriate for gating some
data migration until everything is new enough.

Note that services that do not report a positive version are excluded
from this, as it crosses all cells which will naturally not have all
services.
def get_minimum_version_all_cells(context, binaries, require_all=False):
    "Get the minimum service version, checking all cells.\n\n    This attempts to calculate the minimum service version for a set\n    of binaries across all the cells in the system. If require_all\n    is False, then any cells that fail to report a version will be\n    ignored (assuming they won't be candidates for scheduling and thus\n    excluding them from the minimum version calculation is reasonable).\n    If require_all is True, then a failing cell will cause this to raise\n    exception.CellTimeout, as would be appropriate for gating some\n    data migration until everything is new enough.\n\n    Note that services that do not report a positive version are excluded\n    from this, as it crosses all cells which will naturally not have all\n    services.\n    "
    if (not all((binary.startswith('nova-') for binary in binaries))):
        LOG.warning("get_minimum_version_all_cells called with likely-incorrect binaries `%s'", ','.join(binaries))
        raise exception.ObjectActionError(action='get_minimum_version_all_cells', reason='Invalid binary prefix')
    results = nova_context.scatter_gather_all_cells(context, Service._db_service_get_minimum_version, binaries)
    min_version = None
    for (cell_uuid, result) in results.items():
        if (result is nova_context.did_not_respond_sentinel):
            LOG.warning('Cell %s did not respond when getting minimum service version', cell_uuid)
            if require_all:
                raise exception.CellTimeout()
        elif (result is nova_context.raised_exception_sentinel):
            LOG.warning('Failed to get minimum service version for cell %s', cell_uuid)
            if require_all:
                raise exception.CellTimeout()
        else:
            relevant_versions = [version for version in result.values() if version]
            if relevant_versions:
                min_version_cell = min(relevant_versions)
                min_version = (min(min_version, min_version_cell) if min_version else min_version_cell)
    return (min_version or 0)