7 This tool rejoins any isolated controllers to the cluster.
9 A file named 'cluster.json' containing a list of the IP addresses and
10 credentials of the controllers is required. It resides in the same
11 directory as monitor.py.
13 The file should look like this:
27 Usage:python rejoin.py
33 def import_utility_modules():
34 global UtilLibrary, json
36 sys.path.append('../../../csit/libraries')
41 import_utility_modules()
44 with open('cluster.json') as cluster_file:
45 data = json.load(cluster_file)
47 print str(sys.exc_info())
48 print "unable to open the file cluster.json"
51 cluster_list = data["cluster"]["controllers"]
52 user_name = data["cluster"]["user"]
53 user_pass = data["cluster"]["pass"]
55 print str(sys.exc_info())
56 print 'Error reading the file cluster.json'
59 print UtilLibrary.flush_iptables(cluster_list, user_name, user_pass)