Returns a crontab with jobs from job path

    It replaces jobs previously generated by this function
    It preserves jobs not generated by this function

def generate_crontab(current_crontab, path_to_jobs, path_to_app, unique_id):
    """Returns a crontab with jobs from job path

    It replaces jobs previously generated by this function
    It preserves jobs not generated by this function
    """
    set_disable_envar = ''
    if os.environ.get('DISABLE_COLLECTORS') == 'true':
        set_disable_envar = 'DISABLE_COLLECTORS={} '.format(
            os.environ.get('DISABLE_COLLECTORS'))
    job_template = '{schedule} ' \
                   '{set_disable_envar}' \
                   '{app_path}/venv/bin/pp-collector ' \
                   '-l {collector_slug} ' \
                   '-c {app_path}/config/{credentials} ' \
                   '-t {app_path}/config/{token} ' \
                   '-b {app_path}/config/{performanceplatform} ' \
                   '>> {app_path}/log/out.log 2>> {app_path}/log/error.log'

    crontab = [line.strip() for line in current_crontab]
    crontab = remove_existing_crontab_for_app(crontab, unique_id)
    additional_crontab = []

    job_number = 0
    with open(path_to_jobs) as jobs:
        try:
            for job in jobs:
                parsed = parse_job_line(job)

                if parsed is not None:
                    job_number += 1
                    if skip_job(job_number):
                        continue

                    schedule, collector_slug, credentials, \
                        token, performanceplatform = parsed

                    cronjob = job_template.format(
                        schedule=schedule,
                        set_disable_envar=set_disable_envar,
                        app_path=path_to_app,
                        collector_slug=collector_slug,
                        credentials=credentials,
                        token=token,
                        performanceplatform=performanceplatform
                    )

                    additional_crontab.append(cronjob)

        except ValueError as e:
            raise ParseError(str(e))

    if additional_crontab:
        crontab.append(crontab_begin_comment(unique_id))
        crontab.extend(additional_crontab)
        crontab.append(crontab_end_comment(unique_id))

    return crontab