def __init__(self, hosts=None):

        # Set default value for hosts
        if not hosts:
            hosts = [{"host": "localhost", "port": 9200}]

        # Get connection to ElasticSearch
        try:
            self.els_search = elasticsearch.Elasticsearch(hosts)
            info = self.els_search.info()
            version = info['version']
            print '\t- ELS Indexer connected: %s %s %s %s' % (str(hosts), info['name'],
                                                          version['number'], version['lucene_version'])
        except elasticsearch.exceptions.ConnectionError:
            print '\t- ELS connection failed! Is your ELS server running?'
            exit(1)
Update a machine with new configuration information
dataset/ETHPy150Open SuperCowPowers/workbench/workbench/server/els_indexer.py/ELSIndexer.__init__--crossover with--dataset/ETHPy150Open openstack-infra/shade/shade/operatorcloud.py/OperatorCloud.update_machine