@when(('I launch {num_jobs} {state} jobs for the service "{service}"'
       ' with scheduled chronos instance "{job}"'))
def launch_jobs(context, num_jobs, state, service, job):
    client = context.chronos_client
    jobs = [{
        'async': False,
        'command': 'echo 1',
        'epsilon': 'PT15M',
        'name': compose_job_id(service, job),
        'owner': 'paasta',
        'disabled': True,
        'schedule': 'R/2014-01-01T00:00:00Z/PT60M',
    } for x in range(0, int(num_jobs))]
    for job in jobs:
        try:
            print 'attempting to create job %s' % job['name']
            client.add(job)
        except Exception:
            print 'Error creating test job: %s' % json.dumps(job)
            raise

    # a 'configured' job is one which has had the appropriate
    # yelp-soa configs into place.
    # an 'unconfigured' job represents a job which may at one stage
    # been a configured chronos job, but no longer has the
    # corresponding configuration in place the target for.
    # 'unconfigured' jobs are the target for cleanup_chronos_jobs
    if state == "configured":
        context.configured_job_names = [job['name'] for job in jobs]
    elif state == "unconfigured":
        context.unconfigured_job_names = [job['name'] for job in jobs]
dataset/ETHPy150Open Yelp/paasta/paasta_itests/steps/cleanup_chronos_job_steps.py/launch_jobs/original