Remove "ssconf.CheckMasterCandidate"
authorGuido Trotter <ultrotter@google.com>
Wed, 28 Apr 2010 09:46:26 +0000 (10:46 +0100)
committerGuido Trotter <ultrotter@google.com>
Wed, 28 Apr 2010 11:57:16 +0000 (12:57 +0100)
This function is not used anymore, so there's no point in keeping it
around.

This reverts commit 3f71b464ad5cdd1f1b53f2a31a4eef4e2a5550cc, apart from
a one empty line conflict in ssconf.py

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

lib/constants.py
lib/ssconf.py

index c6d8900..8bedcac 100644 (file)
@@ -331,7 +331,6 @@ EXIT_NOTCLUSTER = 5
 EXIT_NOTMASTER = 11
 EXIT_NODESETUP_ERROR = 12
 EXIT_CONFIRMATION = 13 # need user confirmation
-EXIT_NOTCANDIDATE = 14
 
 # tags
 TAG_CLUSTER = "cluster"
index 966f670..9fa088e 100644 (file)
@@ -497,28 +497,3 @@ def CheckMaster(debug, ss=None):
     if debug:
       sys.stderr.write("Not master, exiting.\n")
     sys.exit(constants.EXIT_NOTMASTER)
-
-
-def CheckMasterCandidate(debug, ss=None):
-  """Checks the node setup.
-
-  If this is a master candidate, the function will return. Otherwise it will
-  exit with an exit code based on the node status.
-
-  """
-  try:
-    if ss is None:
-      ss = SimpleStore()
-    myself = utils.HostInfo().name
-    candidates = ss.GetMasterCandidates()
-  except errors.ConfigurationError, err:
-    print "Cluster configuration incomplete: '%s'" % str(err)
-    sys.exit(constants.EXIT_NODESETUP_ERROR)
-  except errors.ResolverError, err:
-    sys.stderr.write("Cannot resolve my own name (%s)\n" % err.args[0])
-    sys.exit(constants.EXIT_NODESETUP_ERROR)
-
-  if myself not in candidates:
-    if debug:
-      sys.stderr.write("Not master candidate, exiting.\n")
-    sys.exit(constants.EXIT_NOTCANDIDATE)