Skip to content

Commit

Permalink
made setup_chronos_jobs handle non-existant jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
mjksmith committed Feb 17, 2016
1 parent fdb93ac commit c421665
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions paasta_tools/setup_chronos_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,15 @@ def send_event(service, instance, soa_dir, status, output):
:param output: The output to emit for this event
"""
cluster = load_system_paasta_config().get_cluster()
monitoring_overrides = chronos_tools.load_chronos_job_config(
service=service,
instance=instance,
cluster=cluster,
soa_dir=soa_dir,
).get_monitoring()
try:
monitoring_overrides = chronos_tools.load_chronos_job_config(
service=service,
instance=instance,
cluster=cluster,
soa_dir=soa_dir,
).get_monitoring()
except chronos_tools.UnknownChronosJobError:
monitoring_overrides = {}
# In order to let sensu know how often to expect this check to fire,
# we need to set the ``check_every`` to the frequency of our cron job, which
# is 10s.
Expand Down Expand Up @@ -187,7 +190,7 @@ def main():
args.service_instance, cluster)
send_event(
service=service,
instance=None,
instance=instance,
soa_dir=soa_dir,
status=pysensu_yelp.Status.CRITICAL,
output=error_msg,
Expand Down

0 comments on commit c421665

Please sign in to comment.