bitbake: progress: fix hypothetical NameError if 'progress' isn't set

(Bitbake rev: ff821022ef1fdf05482590d8e4fe003abf227135)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Chris Laplante 2020-07-31 11:42:47 -04:00 committed by Richard Purdie
parent e4e6756308
commit 9b41300d47

View File

@ -204,6 +204,7 @@ class MultiStageProgressReporter:
value is considered to be out of stage_total, otherwise it should
be a percentage value from 0 to 100.
"""
progress = None
if self._stage_total:
stage_progress = (float(stage_progress) / self._stage_total) * 100
if self._stage < 0:
@ -212,9 +213,10 @@ class MultiStageProgressReporter:
progress = self._base_progress + (stage_progress * self._stage_weights[self._stage])
else:
progress = self._base_progress
if progress > 100:
progress = 100
self._fire_progress(progress)
if progress:
if progress > 100:
progress = 100
self._fire_progress(progress)
def finish(self):
if self._finished: