]> git.saurik.com Git - redis.git/commitdiff
redis-trib: added cluster state to node info string
authorantirez <antirez@gmail.com>
Thu, 29 Sep 2011 13:04:23 +0000 (15:04 +0200)
committerantirez <antirez@gmail.com>
Thu, 29 Sep 2011 13:04:23 +0000 (15:04 +0200)
src/redis-trib.rb

index 9859b16c02b3fca5215475ba29e8e8f8379c4f92..91b53654273e78dddf8c09238ca109f75b6ae6a5 100755 (executable)
@@ -99,6 +99,7 @@ class ClusterNode
                 @r.cluster("info").split("\n").each{|e|    
                     k,v=e.split(":")
                     k = k.to_sym
+                    v.chop!
                     if k != :cluster_state
                         @info[k] = v.to_i
                     else
@@ -163,7 +164,7 @@ class ClusterNode
             x.count == 1 ? x.first.to_s : "#{x.first}-#{x.last}"
         }.join(",")
 
-        "#{self.to_s.ljust(25)} slots:#{slots}"
+        "[#{@info[:cluster_state].upcase}] #{self.to_s.ljust(25)} slots:#{slots}"
     end
 
     def info