Fix unbound variable re job_name_in_report
If job_name_in_report is false, the 'name' variable may be
undefined. This makes sure it is always defined.
Change-Id: Ie544ccdf1661e08e2aa4c8055999f16e20d7584b
diff --git a/zuul/scheduler.py b/zuul/scheduler.py
index ca084ac..27c5544 100644
--- a/zuul/scheduler.py
+++ b/zuul/scheduler.py
@@ -1137,12 +1137,11 @@
elapsed = ' in %ds' % (s)
else:
elapsed = ''
+ name = ''
if self.sched.config.has_option('zuul', 'job_name_in_report'):
if self.sched.config.getboolean('zuul',
'job_name_in_report'):
name = job.name + ' '
- else:
- name = ''
ret += '- %s%s : %s%s%s\n' % (name, url, result, elapsed,
voting)
return ret