diff options
author | Cole Robinson <crobinso@redhat.com> | 2022-12-14 12:57:10 -0500 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2022-12-14 13:01:48 -0500 |
commit | 4114fa1aa827b836d3a1d11c2ac2d367c9bb0463 (patch) | |
tree | bbc0f33c9206c169d2be886708962911e4a7642a /virtinst | |
parent | b5d6dfaa0dab6c65b3ae4264e62302f2d93a69d4 (diff) | |
download | virt-manager-4114fa1aa827b836d3a1d11c2ac2d367c9bb0463.tar.gz |
progress: Fix showing correct final total
Reproducer:
Reproducer:
./virt-install --connect test:///default \
--location tests/data/fakemedia/fake-f26-netinst.iso
Before:
Starting install...
Retrieving 'vmlinuz' | 0 B 00:00:00 ...
Retrieving 'initrd.img' | 0 B 00:00:00 ...
After:
Starting install...
Retrieving 'vmlinuz' | 9 B 00:00:00 ...
Retrieving 'initrd.img' | 9 B 00:00:00 ...
progress.end() currently only reports the total amount of bytes
that were last written to the UI. It should report the total amount
that's been passed to update().
Reported-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Diffstat (limited to 'virtinst')
-rw-r--r-- | virtinst/_progresspriv.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/virtinst/_progresspriv.py b/virtinst/_progresspriv.py index 5a31a18c..a035c9c4 100644 --- a/virtinst/_progresspriv.py +++ b/virtinst/_progresspriv.py @@ -112,10 +112,10 @@ class BaseMeter: assert type(amount_read) is int now = time.time() + self.last_amount_read = amount_read + self.re.update(amount_read, now) if (not self.last_update_time or (now >= self.last_update_time + self.update_period)): - self.re.update(amount_read, now) - self.last_amount_read = amount_read self.last_update_time = now self._do_update(amount_read) |