From f27eebdede7f42e8ce7aeb44eeed353278311cd0 Mon Sep 17 00:00:00 2001 From: Alan Sebastian Date: Fri, 13 May 2016 17:05:06 -0700 Subject: [PATCH] Remove ipaddress modifications --- lib/elasticsearch/drain/node.rb | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/elasticsearch/drain/node.rb b/lib/elasticsearch/drain/node.rb index ab0aa4b..3220638 100644 --- a/lib/elasticsearch/drain/node.rb +++ b/lib/elasticsearch/drain/node.rb @@ -53,21 +53,21 @@ def name # # @return [String] Elasticsearch node ipaddress def ipaddress - address(info[1]['http_address']).split(':')[0] + info[1]['http_address'].split(':')[0] end # The Elasticsearch node Transport Address # # @return [String] Elasticsearch node Transport Address def transport_address - address(info[1]['transport_address']) + info[1]['transport_address'] end # The Elasticsearch node HTTP Address # # @return [String] Elasticsearch nodes HTTP Address def http_address - address(info[1]['http_address']) + info[1]['http_address'] end # Get size in bytes used for indices for a node @@ -77,14 +77,6 @@ def bytes_stored stats[1]['indices']['store']['size_in_bytes'] end - # Extract ip:port from string passed in - # - # @param [String] str The address object to parse for the ip:port - # @return [String] ip:port pair from the data passed in - def address(str) - str.match(/.+\[\/(.+)\]/)[1] - end - def in_recovery? recovery = client.cat.recovery(format: 'json', v: true).first.values [hostname, name].any? { |a| recovery.include?(a) }