There was an error while loading. Please reload this page.
1 parent 4353aa2 commit 71840d3Copy full SHA for 71840d3
elasticsearch/transport.py
@@ -245,8 +245,16 @@ def _get_host_info(self, host_info):
245
if not address or ":" not in address:
246
return None
247
248
- host["host"], host["port"] = address.rsplit(":", 1)
249
- host["port"] = int(host["port"])
+ if '/' in address:
+ # Support 7.x host/ip:port behavior where http.publish_host has been set.
250
+ fqdn, ipaddress = address.split('/', 1)
251
+ host["host"] = fqdn
252
+ _, host["port"] = ipaddress.rsplit(':', 1)
253
+ host["port"] = int(host["port"])
254
+
255
+ else:
256
+ host["host"], host["port"] = address.rsplit(":", 1)
257
258
259
return self.host_info_callback(host_info, host)
260
0 commit comments