def test_master_only_nodes_are_ignored(self): nodes = [{ 'attributes': { 'data': 'false', 'client': 'true' } }, { 'attributes': { 'data': 'false' } }, { 'attributes': { 'data': 'false', 'master': 'true' } }, { 'attributes': { 'data': 'false', 'master': 'false' } }, { 'attributes': {} }, {}] chosen = [ i for i, node_info in enumerate(nodes) if get_host_info(node_info, i) is not None ] self.assertEquals([0, 3, 4, 5], chosen)
def test_master_only_nodes_are_ignored(self): nodes = [ {'roles': [ "master"]}, {'roles': [ "master", "data", "ingest"]}, {'roles': [ "data", "ingest"]}, {'roles': [ ]}, {} ] chosen = [i for i, node_info in enumerate(nodes) if get_host_info(node_info, i) is not None] self.assertEquals([1, 2, 3, 4], chosen)
def test_master_only_nodes_are_ignored(self): nodes = [ {'attributes': {'data': 'false', 'client': 'true'}}, {'attributes': {'data': 'false'}}, {'attributes': {'data': 'false', 'master': 'true'}}, {'attributes': {'data': 'false', 'master': 'false'}}, {'attributes': {}}, {} ] chosen = [ i for i, node_info in enumerate(nodes) if get_host_info(node_info, i) is not None] self.assertEquals([0, 3, 4, 5], chosen)