Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
bbf1af2d
Commit
bbf1af2d
authored
Oct 23, 2014
by
Matt Stancliff
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
6fbaeddf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-trib.rb
View file @
bbf1af2d
...
@@ -50,14 +50,16 @@ end
...
@@ -50,14 +50,16 @@ end
class
ClusterNode
class
ClusterNode
def
initialize
(
addr
)
def
initialize
(
addr
)
s
=
addr
.
split
(
":"
)
s
=
addr
.
split
(
":"
)
if
s
.
length
!=
2
if
s
.
length
<
2
puts
"Invalid
node name
#{
addr
}
"
puts
"Invalid
IP or Port (given as
#{
addr
}
) - use IP:Port format
"
exit
1
exit
1
end
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
@r
=
nil
@info
=
{}
@info
=
{}
@info
[
:host
]
=
s
[
0
]
@info
[
:host
]
=
ip
@info
[
:port
]
=
s
[
1
]
@info
[
:port
]
=
port
@info
[
:slots
]
=
{}
@info
[
:slots
]
=
{}
@info
[
:migrating
]
=
{}
@info
[
:migrating
]
=
{}
@info
[
:importing
]
=
{}
@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