Description
Symptom: aurora cron show exits with "No cron entry found for job" when cron job does indeed exist.
Error is in cron.py:
jobkey = context.options.jobspec api = context.get_api(jobkey.cluster) resp = api.get_jobs(jobkey.role) context.check_and_log_response(resp, err_code=EXIT_INVALID_PARAMETER, err_msg=("Error getting cron status for %s; see log for details" % jobkey)) for job in resp.result.getJobsResult.configs: if job.key.environment == jobkey.env and job.key.name == jobkey.name: if job.cronSchedule is None or job.cronSchedule == "": context.print_err("No cron entry found for job %s" % jobkey) return EXIT_INVALID_PARAMETER else: context.print_out('%s\t %s' % (jobkey, job.cronSchedule)) return EXIT_OK else: context.print_err("No cron entry found for job %s" % jobkey) return EXIT_INVALID_PARAMETER return EXIT_OK
A request is made for a summary of all jobs in a role, and the loop iterates exactly once and always fails if it encounters a job other than the requested job first.