Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
Remove ipaddress modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
asebastian committed May 14, 2016
1 parent 4e26005 commit f27eebd
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions lib/elasticsearch/drain/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) }
Expand Down

0 comments on commit f27eebd

Please sign in to comment.