Beispiel #1
0
def get_num_masters(state):
    """ Gets the number of masters from mesos state """
    return get_number_of_mesos_masters(get_zookeeper_config(state))
Beispiel #2
0
def test_get_zookeeper_config():
    zk_hosts = "1.1.1.1:1111,2.2.2.2:2222,3.3.3.3:3333"
    zk_path = "fake_path"
    fake_state = {"flags": {"zk": "zk://%s/%s" % (zk_hosts, zk_path)}}
    expected = {"hosts": zk_hosts, "path": zk_path}
    assert mesos_tools.get_zookeeper_config(fake_state) == expected
Beispiel #3
0
def test_get_zookeeper_config():
    zk_hosts = '1.1.1.1:1111,2.2.2.2:2222,3.3.3.3:3333'
    zk_path = 'fake_path'
    fake_state = {'flags': {'zk': 'zk://%s/%s' % (zk_hosts, zk_path)}}
    expected = {'hosts': zk_hosts, 'path': zk_path}
    assert mesos_tools.get_zookeeper_config(fake_state) == expected
Beispiel #4
0
def test_get_zookeeper_config():
    zk_hosts = "1.1.1.1:1111,2.2.2.2:2222,3.3.3.3:3333"
    zk_path = "fake_path"
    fake_state = {"flags": {"zk": f"zk://{zk_hosts}/{zk_path}"}}
    expected = {"hosts": zk_hosts, "path": zk_path}
    assert mesos_tools.get_zookeeper_config(fake_state) == expected
def test_get_zookeeper_config():
    zk_hosts = '1.1.1.1:1111,2.2.2.2:2222,3.3.3.3:3333'
    zk_path = 'fake_path'
    fake_state = {'flags': {'zk': 'zk://%s/%s' % (zk_hosts, zk_path)}}
    expected = {'hosts': zk_hosts, 'path': zk_path}
    assert mesos_tools.get_zookeeper_config(fake_state) == expected
Beispiel #6
0
def get_num_masters(state):
    """ Gets the number of masters from mesos state """
    return get_number_of_mesos_masters(get_zookeeper_config(state))