def __init__(self, address, rqhandler):
"""IOServer constructor
- Args:
- address: the address to bind this IOServer to
- rqhandler: RequestHandler type object
+ @param address: the address to bind this IOServer to
+ @param rqhandler: RequestHandler type object
"""
SocketServer.UnixStreamServer.__init__(self, address, rqhandler)
return queue.ArchiveJob(job_id)
elif method == luxi.REQ_AUTOARCHIVE_JOBS:
- age = args
- return queue.AutoArchiveJobs(age)
+ (age, timeout) = args
+ return queue.AutoArchiveJobs(age, timeout)
elif method == luxi.REQ_WAIT_FOR_JOB_CHANGE:
(job_id, fields, prev_job_info, prev_log_serial, timeout) = args
def ParseOptions():
"""Parse the command line options.
- Returns:
- (options, args) as from OptionParser.parse_args()
+ @return: (options, args) as from OptionParser.parse_args()
"""
parser = OptionParser(description="Ganeti master daemon",
continue
break
if retries == 0:
- logging.critical("Cluster inconsistent, most of the nodes didn't answer"
- " after multiple retries. Aborting startup")
- return False
+ logging.critical("Cluster inconsistent, most of the nodes didn't answer"
+ " after multiple retries. Aborting startup")
+ return False
# here a real node is at the top of the list
all_votes = sum(item[1] for item in votes)
top_node, top_votes = votes[0]
result = False
if top_node != myself:
logging.critical("It seems we are not the master (top-voted node"
- " is %s)", top_node)
+ " is %s with %d out of %d votes)", top_node, top_votes,
+ all_votes)
elif top_votes < all_votes - top_votes:
logging.critical("It seems we are not the master (%d votes for,"
" %d votes against)", top_votes, all_votes - top_votes)
utils.debug = options.debug
utils.no_fork = True
+ if options.fork:
+ utils.CloseFDs()
+
rpc.Init()
try:
ssconf.CheckMaster(options.debug)
# become a daemon
if options.fork:
- utils.Daemonize(logfile=constants.LOG_MASTERDAEMON,
- noclose_fds=[master.fileno()])
+ utils.Daemonize(logfile=constants.LOG_MASTERDAEMON)
utils.WritePidFile(constants.MASTERD_PID)
try: