We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1eba68c commit e23009bCopy full SHA for e23009b
1 file changed
elasticsearch/python_modules/elasticsearch.py
@@ -187,7 +187,10 @@ def metric_init(params):
187
188
host = params.get('host', 'http://localhost:9200/')
189
190
- result = json.load(urllib.urlopen(host))
+ try:
191
+ result = json.load(urllib.urlopen(host))
192
+ except (ValueError, IOError):
193
+ result = {}
194
195
host_version = result.get('version',{}).get('number') or "1.2"
196
version = params.get('version', host_version)
0 commit comments