From 9514aa325192d4d59497fab560ce781b3ed90bbb Mon Sep 17 00:00:00 2001
From: antirez <antirez@gmail.com>
Date: Thu, 29 Sep 2011 15:45:10 +0200
Subject: [PATCH] redis-trib: minor refactoring creating a method to load the
 cluster information starting from a single node

---
 src/redis-trib.rb | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/redis-trib.rb b/src/redis-trib.rb
index 969cbfc3..ac490d28 100755
--- a/src/redis-trib.rb
+++ b/src/redis-trib.rb
@@ -258,9 +258,7 @@ class RedisTrib
         end
     end
 
-    # redis-trib subcommands implementations
-
-    def check_cluster_cmd
+    def load_cluster_info_from_node(nodeaddr)
         node = ClusterNode.new(ARGV[1])
         node.connect(:abort => true)
         node.assert_cluster
@@ -272,6 +270,12 @@ class RedisTrib
             fnode.load_info()
             add_node(fnode)
         }
+    end
+
+    # redis-trib subcommands implementations
+
+    def check_cluster_cmd   
+        load_cluster_info_from_node(ARGV[1])
         check_cluster
     end