示例#1
0
        return {
            'jobs': DEFAULT_JOBS,
            'crontabber.database_class':
            'socorro.external.postgresql.connection_context.ConnectionContext',
            'crontabber.transaction_executor_class':
            'socorro.database.transaction_executor.TransactionExecutor',
            'crontabber.job_state_db_class.database_class':
            'socorro.external.postgresql.connection_context.ConnectionContext',

        }

#------------------------------------------------------------------------------

from crontabber.app import CronTabber

# These settings should ideally be done in config, but because, at
# the moment, it's easier for us to maintain python we're doing it here.
CronTabber.required_config.crontabber.jobs.default = DEFAULT_JOBS
CronTabber.required_config.crontabber.database_class.default = (
    'socorro.external.postgresql.connection_context.ConnectionContext'
)
CronTabber.required_config.crontabber.job_state_db_class.default \
    .required_config.database_class.default = (
        'socorro.external.postgresql.connection_context.ConnectionContext'
    )

if __name__ == '__main__':  # pragma: no cover
    from crontabber.app import main
    import sys
    sys.exit(main(CronTabber))
示例#2
0
        return {
            'jobs':
            DEFAULT_JOBS,
            'crontabber.database_class':
            'socorro.external.postgresql.connection_context.ConnectionContext',
            'crontabber.transaction_executor_class':
            'socorro.database.transaction_executor.TransactionExecutor',
            'crontabber.job_state_db_class.database_class':
            'socorro.external.postgresql.connection_context.ConnectionContext',
        }


#------------------------------------------------------------------------------

from crontabber.app import CronTabber

# These settings should ideally be done in config, but because, at
# the moment, it's easier for us to maintain python we're doing it here.
CronTabber.required_config.crontabber.jobs.default = DEFAULT_JOBS
CronTabber.required_config.crontabber.database_class.default = (
    'socorro.external.postgresql.connection_context.ConnectionContext')
CronTabber.required_config.crontabber.job_state_db_class.default \
    .required_config.database_class.default = (
        'socorro.external.postgresql.connection_context.ConnectionContext'
    )

if __name__ == '__main__':  # pragma: no cover
    from crontabber.app import main
    import sys
    sys.exit(main(CronTabber))
示例#3
0
        reference_namespace=Namespace(),
        list_splitter_fn=line_splitter,
        class_extractor=pipe_splitter,
        extra_extractor=get_extra_as_options)
    return from_string_converter(input_str)


class CronTabberApp(CronTabberBase, App):
    required_config = CronTabberBase.required_config.safe_copy()

    # Stomp on the existing "crontabber.jobs" configuration with one that can
    # also take Python dotted paths
    required_config.crontabber.add_option(
        'jobs',
        default='socorro.cron.crontabber_app.DEFAULT_JOBS',
        from_string_converter=jobs_converter,
        doc='Crontabber jobs spec or Python dotted path to jobs spec',
    )


# NOTE(willkg): We need to "fix" the defaults here rather than use App's
# get_application_defaults() because that doesn't support nested configuration
# defaults
CronTabberApp.required_config.crontabber.database_class.default = (
    'socorro.external.postgresql.connection_context.ConnectionContext')
CronTabberApp.required_config.crontabber.job_state_db_class.default.required_config.database_class.default = (  # noqa
    'socorro.external.postgresql.connection_context.ConnectionContext')

if __name__ == '__main__':
    sys.exit(main(CronTabberApp))