[virt-tools-list] [virt-manager PATCH] storage: remove attempt counter from disk allocation thread
Cole Robinson
crobinso at redhat.com
Thu Nov 19 14:49:12 UTC 2015
On 11/19/2015 09:11 AM, Pavel Hrdina wrote:
> 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 at redhat.com>
> ---
> virtinst/storage.py | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/virtinst/storage.py b/virtinst/storage.py
> index e50b78f..9901cfb 100644
> --- a/virtinst/storage.py
> +++ b/virtinst/storage.py
> @@ -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.")
>
ACK
- Cole
More information about the virt-tools-list
mailing list