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)
예제 #2
0
 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)
예제 #3
0
 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)
예제 #4
0
 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)