- ack

 

On Thursday 20 of September 2012 10:27:03 Jiri Moskovcak wrote:

> - otherwise the information *why* the download is failing is

> not propagated to the gui and users don't know what's wrong

> ---

> src/client-python/debuginfo.py | 8 ++++++++

> 1 file changed, 8 insertions(+)

>

> diff --git a/src/client-python/debuginfo.py b/src/client-python/debuginfo.py

> index 72bbadb..c9e81cd 100644

> --- a/src/client-python/debuginfo.py

> +++ b/src/client-python/debuginfo.py

> @@ -131,6 +131,13 @@ class MyDownloadCallback(DownloadBaseCallback):

>

> sys.stdout.flush()

>

> +def downloadErrorCallback(callBackObj):

> + print _("Problem '{0!s}' occured while downloading from mirror:

> '{1!s}'. Trying next one").format( + callBackObj.exception,

> callBackObj.mirror)

> + # explanation of the return value can be found here:

> + # /usr/lib/python2.7/site-packages/urlgrabber/mirror.py

> + return {'fail':0}

> +

> class DebugInfoDownload(YumBase):

> def __init__(self, cache, tmp, keep_rpms=False, noninteractive=True):

> self.cachedir = cache

> @@ -257,6 +264,7 @@ class DebugInfoDownload(YumBase):

> # connect our progress update callback

> dnlcb = MyDownloadCallback(total_pkgs)

> self.repos.setProgressBar(dnlcb)

> + self.repos.setMirrorFailureCallback(downloadErrorCallback)

>

> if verbose != 0 or len(not_found) != 0:

> print _("Can't find packages for {0} debuginfo

> files").format(len(not_found))