Bug 179512 - yum - a call with a non-existent configuration file results in a traceback
Summary: yum - a call with a non-existent configuration file results in a traceback
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-01-31 22:58 UTC by Michal Jaegermann
Modified: 2014-01-21 22:53 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-02-10 06:42:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Michal Jaegermann 2006-01-31 22:58:21 UTC
Description of problem:

If 'yum' is called like, say, that:

    yum -c ./local.conf update

but local.conf does not exist (a typo in a path, or temporary inaccesible
if retrieved over a network) then, instead of bailing out with an error
message, 'yum' produces this misleading traceback:

Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.main(sys.argv[1:])
  File "/usr/share/yum-cli/yummain.py", line 80, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 169, in getOptionsConfig
    self.doConfigSetup(fn=opts.conffile, root=root)
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 97, in doConfigSetup
    self.conf = config.readMainConfig(fn, root)
  File "/usr/lib/python2.4/site-packages/yum/config.py", line 482, in readMainConfig
    setattr(yumconf, option, yumconf.installroot + path)
  File "/usr/lib/python2.4/site-packages/yum/config.py", line 72, in __set__
    optdata.parser.set(optdata.section, optdata.name, strvalue)
  File "/usr/lib/python2.4/site-packages/yum/parser.py", line 181, in set
    return ConfigParser.set(self, section, option, value)
  File "/usr/lib64/python2.4/ConfigParser.py", line 358, in set
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'main'

Indeed, there is no section 'main', or any other one, if the file cannot
be accessed.

Version-Release number of selected component (if applicable):
yum-2.5.1-2

Comment 1 Seth Vidal 2006-02-10 06:42:23 UTC
thanks - fixed in upstream.
will be out in yum 2.5.2



Note You need to log in before you can comment on or make changes to this bug.