elasticsearch-drain 0.1.16 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/elasticsearch/drain/node.rb +10 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07fe00683cd1b132351470483926384323c2a206814ef8591502f05f31db2e10
|
4
|
+
data.tar.gz: 8f0f7ed089a8303fea9709e2e225f10da07c85ff58239944164c6a803e1ad6c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec6d977ad2e3a34f6400e5171a6990fc624524e2bbdfa7899e9b2575b3a74b3a71b7bd9a37ffc0671bd6b1e2eabef0b06eb19d20d2f5da73a64a8e7cf9fdfd77
|
7
|
+
data.tar.gz: 9fd685d825244110c1227d4af363cb6752d175be7a407fa7cab2eaa51d02976b0c30b21eb815778757578d1923eff49453ff35004e994172839a74ddeeb16328
|
@@ -50,13 +50,20 @@ module Elasticsearch
|
|
50
50
|
end
|
51
51
|
|
52
52
|
# The Elasticsearch node ipaddress
|
53
|
+
#
|
54
|
+
# For ES v1.x, we must extract and modify the IP
|
55
|
+
# address from the http_address key. For all later
|
56
|
+
# versions, we can use the host key directly.
|
57
|
+
# That's why we check with the if/else statement.
|
53
58
|
#
|
54
59
|
# @return [String] Elasticsearch node ipaddress
|
55
60
|
def ipaddress
|
56
|
-
|
57
|
-
|
61
|
+
block = /\d{,2}|1\d{2}|2[0-4]\d|25[0-5]/
|
62
|
+
re = /\A#{block}\.#{block}\.#{block}\.#{block}\z/
|
63
|
+
if info[1]['host'] && re =~ info[1]['host']
|
64
|
+
info[1]['host']
|
58
65
|
else
|
59
|
-
address(info[1]['http_address']).split(':')[0]
|
66
|
+
address(info[1]['http_address']).split(':')[0]
|
60
67
|
end
|
61
68
|
end
|
62
69
|
|