Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
bb0ff49e
Commit
bb0ff49e
authored
Oct 23, 2014
by
Matt Stancliff
Committed by
antirez
Oct 31, 2014
Browse files
Fix redis-trib.rb IP:Port disassembly for IPv6
IP format is now any of: - 127.0.0.1:6379 - ::1:6379
parent
f1a6f780
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-trib.rb
View file @
bb0ff49e
...
...
@@ -50,14 +50,16 @@ end
class ClusterNode
def initialize(addr)
s = addr.split(":")
if s.length
!=
2
puts "Invalid
node name #{addr}
"
exit 1
if s.length
<
2
puts "Invalid
IP or Port (given as #{addr}) - use IP:Port format
"
exit 1
end
port = s.pop # removes port from split array
ip = s.join(":") # if s.length > 1 here, it's IPv6, so restore address
@r = nil
@info = {}
@info[:host] =
s[0]
@info[:port] =
s[1]
@info[:host] =
ip
@info[:port] =
port
@info[:slots] = {}
@info[:migrating] = {}
@info[:importing] = {}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment