[Yum-devel] [PATCH] Rearrange the free space checking code

James Antill james at fedoraproject.org
Mon Aug 8 16:44:51 UTC 2011


On Mon, 2011-08-08 at 17:30 +0200, Zdeněk Pavlas wrote:
> Early free space checking is currently implemented only for rpms
> and drpms only, and in two different places.  The repo._getFile()
> function has all relevant data, so we can implement it there.
> 
> - free space check can be removed from presto.py
> - most metadata downloads fail gratefully instead of a traceback
> - likely resolves BZ 728848.
> ---
>  cli.py          |    2 +-
>  yum/__init__.py |   10 ----------
>  yum/yumRepo.py  |   13 +++++++++++++
>  3 files changed, 14 insertions(+), 11 deletions(-)
> 
> diff --git a/cli.py b/cli.py
> index 43c0e1d..bf8be26 100755
> --- a/cli.py
> +++ b/cli.py
> @@ -457,7 +457,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
>              try:
>                  self._getTs(needTsRemove)
>              except yum.Errors.YumBaseError, e:
> -                return 1, [str(e)]
> +                return 1, [to_utf8(e)]

 This can't be "right", although I wouldn't be shocked to find out the
original is "wrong" in some cases.
 At a guess it should probably be [exception2msg(e)], might as well put
that in a different patch though.

[...]

>          if url and scheme != "media":
>              ugopts = self._default_grabopts(cache=cache)
>              ug = URLGrabber(progress_obj = self.callback,
> @@ -1454,6 +1466,7 @@ class YumRepository(Repository, config.RepoConf):
>          try:
>              self._loadRepoXML(text=self)
>          except Errors.RepoError, e:
> +            logger.error(misc.to_utf8(e))

 Dito. the to_utf8 does nothing here.

>              msg = ("Cannot retrieve repository metadata (repomd.xml) for repository: %s. "
>                    "Please verify its path and try again" % self )
>              raise Errors.RepoError, msg




More information about the Yum-devel mailing list