iElasticsearch 2.0 exposes just host:port in nodes.info

Fixes #293
This commit is contained in:
Honza Král
2015-11-02 14:26:28 +01:00
parent 5e97002f28
commit 1b60d9bf84
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -8,8 +8,8 @@ from .serializer import JSONSerializer, Deserializer, DEFAULT_SERIALIZERS
from .exceptions import ConnectionError, TransportError, SerializationError, \
ConnectionTimeout, ImproperlyConfigured
# get ip/port from "inet[wind/127.0.0.1:9200]"
ADDRESS_RE = re.compile(r'/(?P<host>[\.:0-9a-f]*):(?P<port>[0-9]+)\]?$')
# get ip/port from "127.0.0.1:9200"
ADDRESS_RE = re.compile(r'^(?P<host>[\.:0-9a-f]*):(?P<port>[0-9]+)?$')
def get_host_info(node_info, host):
+3 -3
View File
@@ -29,11 +29,11 @@ CLUSTER_NODES = '''{
"nodes" : {
"wE_6OGBNSjGksbONNncIbg" : {
"name" : "Nightwind",
"transport_address" : "inet[/127.0.0.1:9300]",
"transport_address" : "127.0.0.1:9300",
"hostname" : "wind",
"version" : "0.20.4",
"http_address" : "inet[/1.1.1.1:123]",
"thrift_address" : "/1.1.1.1:9500]"
"http_address" : "1.1.1.1:123",
"thrift_address" : "1.1.1.1:9500"
}
}
}'''