From b6c318724b8f80916056b75fb8040696763c6118 Mon Sep 17 00:00:00 2001 From: Adam Saleh Date: Mar 01 2021 20:42:26 +0000 Subject: Fixing issue with unitialized variable --- diff --git a/monitor_gating/runner.py b/monitor_gating/runner.py index 1d72bdc..ab420d8 100644 --- a/monitor_gating/runner.py +++ b/monitor_gating/runner.py @@ -81,6 +81,7 @@ def schedule(conf): print("Tests started:", datetime.datetime.utcnow(), flush=True) runid = f"{datetime.datetime.utcnow().year}-{uuid.uuid4()}" + monit_utils = None try: # Single Build Gating single_args = conf["workflow_single_gating_args"].split() @@ -164,13 +165,14 @@ def schedule(conf): notify( topic=f"multi-build.end.error", message={"runid": runid, "exception": str(err)}, ) - report_failure( - report_project, - report_api_token, - report_env, - "multi-package", - monit_utils, - ) + if monit_utils: + report_failure( + report_project, + report_api_token, + report_env, + "multi-package", + monit_utils, + ) delay_when_failing = conf["delay_when_failing"] blocker_tags = conf["blocker_tags"]