def process(args, repo_configs): if args.sendmail_binary: phlsys_sendmail.Sendmail.set_default_binary( args.sendmail_binary) if args.sendmail_type: phlsys_sendmail.Sendmail.set_default_params_from_type( args.sendmail_type) mail_sender = phlmail_sender.MailSender( phlsys_sendmail.Sendmail(), args.arcyd_email) if args.io_log_file: full_path = os.path.abspath(args.io_log_file) abdt_logging.set_remote_io_write_log_path(full_path) if args.external_error_logger: full_path = os.path.abspath(args.external_error_logger) abdt_logging.set_external_system_error_logger(full_path) on_exception = abdt_exhandlers.make_exception_message_handler( args.sys_admin_emails, None, "arcyd stopped with exception", "") _processrepolist( args, repo_configs, on_exception, mail_sender)
def process(args, repo_configs): if args.sendmail_binary: phlsys_sendmail.Sendmail.set_default_binary( args.sendmail_binary) if args.sendmail_type: phlsys_sendmail.Sendmail.set_default_params_from_type( args.sendmail_type) reporter_data = abdt_shareddictoutput.ToFile(args.status_path) reporter = abdt_arcydreporter.ArcydReporter( reporter_data, args.arcyd_email, args.io_log_file) if args.external_error_logger: full_path = os.path.abspath(args.external_error_logger) reporter.set_external_system_error_logger(full_path) on_exception = abdt_exhandlers.make_exception_message_handler( args.sys_admin_emails, reporter, None, "arcyd stopped with exception", "") arcyd_reporter_context = abdt_logging.arcyd_reporter_context with contextlib.closing(reporter), arcyd_reporter_context(reporter): _processrepolist(args, repo_configs, reporter, on_exception)
def process(args, repo_configs): if args.sendmail_binary: phlsys_sendmail.Sendmail.set_default_binary(args.sendmail_binary) if args.sendmail_type: phlsys_sendmail.Sendmail.set_default_params_from_type( args.sendmail_type) mail_sender = phlmail_sender.MailSender(phlsys_sendmail.Sendmail(), args.arcyd_email) if args.external_error_logger: full_path = os.path.abspath(args.external_error_logger) abdt_logging.set_external_system_error_logger(full_path) on_exception = abdt_exhandlers.make_exception_message_handler( args.sys_admin_emails, None, "arcyd stopped with exception", "") return _processrepolist(args, repo_configs, on_exception, mail_sender)
def process(args): phlsys_signal.set_exit_on_sigterm() if args.sendmail_binary: phlsys_sendmail.Sendmail.set_default_binary( args.sendmail_binary) if args.sendmail_type: phlsys_sendmail.Sendmail.set_default_params_from_type( args.sendmail_type) reporter_data = abdt_shareddictoutput.ToFile(args.status_path) reporter = abdt_arcydreporter.ArcydReporter( reporter_data, args.io_log_file) if args.external_error_logger: full_path = os.path.abspath(args.external_error_logger) reporter.set_external_system_error_logger(full_path) on_exception = abdt_exhandlers.make_exception_message_handler( args, reporter, None, "arcyd stopped with exception", "") arcyd_reporter_context = abdt_logging.arcyd_reporter_context with contextlib.closing(reporter), arcyd_reporter_context(reporter): try: _process(args, reporter) except BaseException: on_exception("Arcyd will now stop") print "stopping" raise if not args.no_loop: # we should never get here, raise and handle an exception if we do try: raise Exception("Arcyd stopped unexpectedly") except Exception: on_exception("Arcyd will now stop")