def Main():
  opts = ParseOptions()

  utils.SetupToolLogging(
      opts.debug, opts.verbose,
      toolname=os.path.splitext(os.path.basename(__file__))[0])

  try:
    data = common.LoadData(sys.stdin.read(), _DATA_CHECK)

    # Check if input data is correct
    common.VerifyClusterName(data, JoinError, constants.SSHS_CLUSTER_NAME)
    common.VerifyCertificateSoft(data, JoinError)

    # Update SSH files
    UpdateSshDaemon(data, opts.dry_run)
    UpdateSshRoot(data, opts.dry_run)

    logging.info("Setup finished successfully")
  except Exception, err: # pylint: disable=W0703
    logging.debug("Caught unhandled exception", exc_info=True)

    (retcode, message) = cli.FormatError(err)
    logging.error(message)

    return retcode
  else:
    return constants.EXIT_SUCCESS
Main routine.
dataset/ETHPy150Open ganeti/ganeti/lib/tools/prepare_node_join.py/Main