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
f29d1fb0
Commit
f29d1fb0
authored
Apr 11, 2011
by
Salvatore Sanfilippo
Browse files
assert_empty in redis-trib
parent
8c4c5090
Changes
1
Show whitespace changes
Inline
Side-by-side
src/redis-trib.rb
View file @
f29d1fb0
...
...
@@ -43,6 +43,14 @@ class ClusterNode
end
end
def
assert_empty
if
!
(
@r
.
cluster
(
"info"
).
split
(
"
\r\n
"
).
index
(
"cluster_known_nodes:1"
))
||
(
@r
.
info
[
'db0'
])
puts
"Error: Node
#{
self
}
is not empty. Either the node already knows other nodes (check with nodes-info) or contains some key in database 0."
exit
1
end
end
def
r
@r
end
...
...
@@ -63,7 +71,7 @@ class RedisTrib
node
=
ClusterNode
.
new
(
n
)
node
.
connect
node
.
assert_cluster
#
node.assert_empty
node
.
assert_empty
}
end
end
...
...
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