From 1c69ad80a2d8343d1be166bba535ec821cf12d32 Mon Sep 17 00:00:00 2001 From: Guido Trotter <ultrotter@google.com> Date: Wed, 28 Apr 2010 10:46:26 +0100 Subject: [PATCH] Remove "ssconf.CheckMasterCandidate" 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 | 1 - lib/ssconf.py | 25 ------------------------- 2 files changed, 26 deletions(-) diff --git a/lib/constants.py b/lib/constants.py index c6d89001c..8bedcac55 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -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" diff --git a/lib/ssconf.py b/lib/ssconf.py index 966f670a2..9fa088e1b 100644 --- a/lib/ssconf.py +++ b/lib/ssconf.py @@ -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) -- GitLab