Merge pull request #56 from signalfx/error-handling
Bail out early if cluster state cannot be determined
This commit is contained in:
Коммит
b2e53022c2
|
@ -2,7 +2,7 @@ version: '2'
|
|||
jobs:
|
||||
build:
|
||||
docker:
|
||||
- image: ubuntu:yakkety
|
||||
- image: ubuntu:xenial
|
||||
working_directory: ~/code
|
||||
steps:
|
||||
- setup_remote_docker
|
||||
|
|
|
@ -1019,6 +1019,10 @@ class Cluster(object):
|
|||
cluster_state = self.fetch_url(self.es_url_scheme + "://" +
|
||||
self.es_host + ":" + str(self.es_port) +
|
||||
"/_cluster/state/master_node")
|
||||
if cluster_state is None:
|
||||
self.es_current_master = False
|
||||
return
|
||||
|
||||
if self.es_current_master is False \
|
||||
and cluster_state['master_node'] == self.node_id:
|
||||
self.es_current_master = True
|
||||
|
|
Загрузка…
Ссылка в новой задаче