Exemple #1
0
def get_config_manager_for_crontabber(
    more_definitions=None,
    jobs=None,
    overrides=None,
):
    if isinstance(more_definitions, Sequence):
        more_definitions = more_definitions.append(
            CronTabber.get_required_config()
        )
    elif more_definitions is not None:
        more_definitions = [
            more_definitions,
            CronTabber.get_required_config()
        ]
    else:
        more_definitions = [CronTabber.get_required_config()]

    local_overrides = {
        'logger': Mock(),
    }
    if jobs:
        local_overrides['crontabber.jobs'] = jobs

    if isinstance(overrides, Sequence):
        overrides.append(local_overrides)
    elif overrides is not None:
        overrides = [overrides, local_overrides]
    else:
        overrides = [local_overrides]

    return get_standard_config_manager(
        more_definitions=more_definitions,
        overrides=overrides
    )
Exemple #2
0
def get_config_manager_for_crontabber(
    more_definitions=None,
    jobs=None,
    overrides=None,
):
    if isinstance(more_definitions, Sequence):
        more_definitions = more_definitions.append(
            CronTabber.get_required_config()
        )
    elif more_definitions is not None:
        more_definitions = [
            more_definitions,
            CronTabber.get_required_config()
        ]
    else:
        more_definitions = [CronTabber.get_required_config()]

    local_overrides = {
        'logger': Mock(),
    }
    if jobs:
        local_overrides['crontabber.jobs'] = jobs

    if isinstance(overrides, Sequence):
        overrides.append(local_overrides)
    elif overrides is not None:
        overrides = [overrides, local_overrides]
    else:
        overrides = [local_overrides]

    return get_standard_config_manager(
        more_definitions=more_definitions,
        overrides=overrides
    )
def get_config_manager_for_crontabber(
    more_definitions=None,
    jobs=None,
    overrides=None,
):
    if isinstance(more_definitions, Sequence):
        more_definitions = more_definitions.append(
            CronTabber.get_required_config())
    elif more_definitions is not None:
        more_definitions = [more_definitions, CronTabber.get_required_config()]
    else:
        more_definitions = [CronTabber.get_required_config()]

    local_overrides = {
        'logger': Mock(),
        #'resource.redactor.redactor_class': Mock(),
        'resource.postgresql.database_name': 'socorro_integration_test',
        'resource.postgresql.database_hostname': 'localhost',
        'secrets.postgresql.database_username': '******',
        'secrets.postgresql.database_password': '******',
    }
    if jobs:
        local_overrides['crontabber.jobs'] = jobs

    if isinstance(overrides, Sequence):
        overrides.append(local_overrides)
    elif overrides is not None:
        overrides = [overrides, local_overrides]
    else:
        overrides = [local_overrides]

    return get_standard_config_manager(more_definitions=more_definitions,
                                       overrides=overrides)
def get_config_manager_for_crontabber(
    more_definitions=None,
    jobs=None,
    overrides=None,
):
    if isinstance(more_definitions, Sequence):
        more_definitions = more_definitions.append(
            CronTabber.get_required_config()
        )
    elif more_definitions is not None:
        more_definitions = [
            more_definitions,
            CronTabber.get_required_config()
        ]
    else:
        more_definitions = [CronTabber.get_required_config()]

    local_overrides = {
        'logger': Mock(),
        #'resource.redactor.redactor_class': Mock(),
        'resource.postgresql.database_name': 'socorro_integration_test',
        'resource.postgresql.database_hostname': 'localhost',
        'secrets.postgresql.database_username': '******',
        'secrets.postgresql.database_password': '******',
    }
    if jobs:
        local_overrides['crontabber.jobs'] = jobs

    if isinstance(overrides, Sequence):
        overrides.append(local_overrides)
    elif overrides is not None:
        overrides = [overrides, local_overrides]
    else:
        overrides = [local_overrides]

    return get_standard_config_manager(
        more_definitions=more_definitions,
        overrides=overrides
    )