mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-02 09:47:16 +03:00
storage: remove attempt counter from disk allocation thread
Remove the lookup counter from _progress_thread, it's not necessary, the loop is terminated by _install_finished boolean. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1270277 Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
e68efe8103
commit
0ccbcd8883
@ -809,25 +809,20 @@ class StorageVolume(_StorageObject):
|
||||
"'%s': '%s'" % (self.name, str(e)))
|
||||
|
||||
def _progress_thread(self, meter):
|
||||
lookup_attempts = 10
|
||||
vol = None
|
||||
if not meter:
|
||||
return
|
||||
|
||||
while lookup_attempts > 0:
|
||||
while True:
|
||||
try:
|
||||
if not vol:
|
||||
vol = self.pool.storageVolLookupByName(self.name)
|
||||
vol.info()
|
||||
break
|
||||
except:
|
||||
lookup_attempts -= 1
|
||||
time.sleep(.2)
|
||||
if self._install_finished:
|
||||
break
|
||||
else:
|
||||
continue
|
||||
break
|
||||
|
||||
if vol is None:
|
||||
logging.debug("Couldn't lookup storage volume in prog thread.")
|
||||
|
Loading…
x
Reference in New Issue
Block a user