Bug 179512 - yum - a call with a non-existent configuration file results in a traceback
yum - a call with a non-existent configuration file results in a traceback
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
Depends On:
  Show dependency treegraph
Reported: 2006-01-31 17:58 EST by Michal Jaegermann
Modified: 2014-01-21 17:53 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-02-10 01:42:23 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Michal Jaegermann 2006-01-31 17:58:21 EST
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 ?
  File "/usr/share/yum-cli/yummain.py", line 80, in main
  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):
Comment 1 Seth Vidal 2006-02-10 01:42:23 EST
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.