예제 #1
0
def multi_master():
    """Returns True if this is a multi master cluster. This is useful in
       using pytest skipif when testing single master clusters such as:
       `pytest.mark.skipif('multi_master')` which will skip the test if
       the number of masters is > 1.
    """
    # reverse logic (skip if multi master cluster)
    return len(shakedown.get_all_masters()) > 1
예제 #2
0
파일: common.py 프로젝트: guenter/marathon
def multi_master():
    """Returns True if this is a multi master cluster. This is useful in
       using pytest skipif when testing single master clusters such as:
       `pytest.mark.skipif('multi_master')` which will skip the test if
       the number of masters is > 1.
    """
    # reverse logic (skip if multi master cluster)
    return len(shakedown.get_all_masters()) > 1
예제 #3
0
def not_required_masters_exact_count(count):
    """ Returns True if the number of masters is equal to
    the count.  This is useful in using pytest skipif such as:
    `pytest.mark.skipif('required_masters(3)')` which will skip the test if
    the number of masters is only 1.
    :param count: the number of required masters.
    """
    master_count = len(shakedown.get_all_masters())
    # reverse logic (skip if less than count)
    # returns True if less than count
    return master_count != count
예제 #4
0
파일: common.py 프로젝트: dcos/metronome
def not_required_masters_exact_count(count):
    """ Returns True if the number of masters is equal to
    the count.  This is useful in using pytest skipif such as:
    `pytest.mark.skipif('required_masters(3)')` which will skip the test if
    the number of masters is only 1.
    :param count: the number of required masters.
    """
    master_count = len(shakedown.get_all_masters())
    # reverse logic (skip if less than count)
    # returns True if less than count
    return master_count != count
예제 #5
0
파일: common.py 프로젝트: zuker/marathon
def get_cluster_metadata():

    try:
        version = ee_version()
    except Exception:
        version = None

    resources = available_resources()
    metadata = {
        'dcos-version': dcos_version(),
        'marathon-version': get_marathon_version(),
        'private-agents': len(get_private_agents()),
        'master-count': len(shakedown.get_all_masters()),
        'resources': {
            'cpus': resources.cpus,
            'memory': resources.mem
        },
        'marathon': 'root'
    }

    if version is not None:
        metadata['security'] = version

    return metadata
예제 #6
0
def get_cluster_metadata():

    try:
        version = ee_version()
    except:
        version = None

    resources = available_resources()
    metadata = {
        'dcos-version': dcos_version(),
        'marathon-version': get_marathon_version(),
        'private-agents': len(get_private_agents()),
        'master-count': len(shakedown.get_all_masters()),
        'resources': {
            'cpus': resources.cpus,
            'memory': resources.mem
        },
        'marathon': 'root'
    }

    if version is not None:
        metadata['security'] = version

    return metadata