Skip to content

Commit

Permalink
fpgasupdate:set the progress bar's maximum value to 100% if it exceeds (
Browse files Browse the repository at this point in the history
#3104)

fpgasupdate progress bars display 200% or 300% for root key hash and cancel key programming, which exceeds 100%.
 set the progress bar maximum to 100% if the computations exceed 100.

Signed-off-by: anandaravuri <ananda.ravuri@intel.com>
  • Loading branch information
anandaravuri authored Feb 15, 2024
1 parent 974571d commit 195ca07
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/opae.admin/opae/admin/utils/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ def _update_percent(self, pct, ratio=None):
function, otherwise, None.
"""
percent = int(pct*100)
if percent > 100:
percent = 100
num_bars = int(pct*self._total_bars)
bars = self.BAR*num_bars
spaces = ' '*(self._total_bars - num_bars)
Expand Down

0 comments on commit 195ca07

Please sign in to comment.