Revision 340f4757 daemons/ganeti-masterd

b/daemons/ganeti-masterd
463 463
  return result
464 464

  
465 465

  
466
@rpc.RunWithRPC
467
def ActivateMasterIP():
468
  # activate ip
469
  master_node = ssconf.SimpleStore().GetMasterNode()
470
  result = rpc.RpcRunner.call_node_start_master(master_node, False, False)
471
  msg = result.fail_msg
472
  if msg:
473
    logging.error("Can't activate master IP address: %s", msg)
474

  
475

  
466 476
def CheckMasterd(options, args):
467 477
  """Initial checks whether to run or exit with a failure.
468 478

  
......
505 515
  if not utils.RunInSeparateProcess(CheckAgreement):
506 516
    sys.exit(constants.EXIT_FAILURE)
507 517

  
518
  # ActivateMasterIP also uses RPC/threads, so we run it again via a
519
  # separate process.
520

  
521
  # TODO: decide whether failure to activate the master IP is a fatal error
522
  utils.RunInSeparateProcess(ActivateMasterIP)
523

  
508 524

  
509 525
def ExecMasterd(options, args): # pylint: disable-msg=W0613
510 526
  """Main master daemon function, executed with the PID file held.
......
520 536
  try:
521 537
    rpc.Init()
522 538
    try:
523
      # activate ip
524
      master_node = ssconf.SimpleStore().GetMasterNode()
525
      result = rpc.RpcRunner.call_node_start_master(master_node, False, False)
526
      msg = result.fail_msg
527
      if msg:
528
        logging.error("Can't activate master IP address: %s", msg)
529

  
530 539
      master.setup_queue()
531 540
      try:
532 541
        mainloop.Run()

Also available in: Unified diff