[Yum-devel] [PATCH] honor retries config option at mirror group level rather than grabber level

Zdenek Pavlas zpavlas at redhat.com
Fri Jul 13 13:47:29 UTC 2012


Hi,

> Ok, updated patches attached. Keeping the tries count in
> urlgrabber/mirror.py and exposing that to the callback.

Just some nitpicking:

> +        cb_obj = (self._mirrorFailureHandler, (), {})

Could pass the function directly, no need for a tuple.

     def _default_grabopts(self, cache=True):
-                 'retry': self.retries,

Better leave it there.  It's ignored by MirrorGroup code,
but we still want metalink.xml download to use it.

> +        ext_cb = self.mirror_failure_obj
> +        if ext_cb:
> +          ..

mirror_failure_obj is set in repos.setMirrorFailureCallback(),
but there seem to be no users, so it's probably always None.
But it does not hurt, and there are plugins.. ok.

+        if gr.tries == max(self.retries, len(self.urls)):

I'm tempted to just "gr.tries == self.retries" there.
That'd literally follow the 'retries'option doc, anyway.
Do we have to try all mirrors, for some reason?


More information about the Yum-devel mailing list