[Yum-devel] [PATCH] Report IOError while setting self.conf. BZ 734907

James Antill james at fedoraproject.org
Mon Sep 19 15:56:54 UTC 2011


On Mon, 2011-09-19 at 17:38 +0200, Zdeněk Pavlas wrote:
> - While reading config files, IOError was not handled.  Fix that.
> - Build uuid file path properly.
> ---
>  cli.py        |    3 +++
>  yum/config.py |    2 +-
>  2 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/cli.py b/cli.py
> index ed29ba4..93990b6 100755
> --- a/cli.py
> +++ b/cli.py
> @@ -268,6 +268,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
>          except yum.Errors.ConfigError, e:
>              self.logger.critical(_('Config Error: %s'), e)
>              sys.exit(1)
> +        except IOError, e:
> +            self.logger.critical('%s: %s' % (to_unicode(e.args[1]), repr(e.filename)))
> +            sys.exit(1)
>          except ValueError, e:
>              self.logger.critical(_('Options Error: %s'), e)
>              sys.exit(1)

 Sorry, I had already committed this ... but I'd planned on pushing and
building a rawhide on Friday, but got "distracted" by events of the day.

> diff --git a/yum/config.py b/yum/config.py
> index ef1b9e1..d2b0f24 100644
> --- a/yum/config.py
> +++ b/yum/config.py
> @@ -982,7 +982,7 @@ def readStartupConfig(configfile, root, releasever=None):
>                                  startupconf.distroverpkg)
>      startupconf.releasever = releasever
>  
> -    uuidfile = '%s/%s/uuid' % (startupconf.installroot, startupconf.persistdir)
> +    uuidfile = os.path.join(startupconf.installroot, startupconf.persistdir, 'uuid')
>      startupconf.uuid = get_uuid(uuidfile)
>  
>      return startupconf




More information about the Yum-devel mailing list