diff --git a/daemons/ganeti-noded b/daemons/ganeti-noded index 9600e30ec6576cf41f1ba360ba81e7688bba5626..8b100761472d2c3d437d7d29ce9d2a0f9b61cb32 100755 --- a/daemons/ganeti-noded +++ b/daemons/ganeti-noded @@ -754,13 +754,9 @@ def main(): for fname in (constants.SSL_CERT_FILE,): if not os.path.isfile(fname): print "config %s not there, will not run." % fname - sys.exit(5) + sys.exit(constants.EXIT_NOTCLUSTER) - try: - port = utils.GetNodeDaemonPort() - except errors.ConfigurationError, err: - print "Cluster configuration incomplete: '%s'" % str(err) - sys.exit(5) + port = utils.GetNodeDaemonPort() dirs = [(val, constants.RUN_DIRS_MODE) for val in constants.SUB_RUN_DIRS] dirs.append((constants.LOG_OS_DIR, 0750)) diff --git a/lib/constants.py b/lib/constants.py index 05226c03fe0686f88ab84b8f6b4ad7ccf29d9378..9df5d719640861e41f970de1129bec9f59a0d334 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -224,6 +224,7 @@ DDM_REMOVE = 'remove' # common exit codes EXIT_SUCCESS = 0 EXIT_FAILURE = 1 +EXIT_NOTCLUSTER = 5 EXIT_NOTMASTER = 11 EXIT_NODESETUP_ERROR = 12 EXIT_CONFIRMATION = 13 # need user confirmation