Bug 199863 - Pirut doesn't call doPluginSetup() properly, so plugins like yum-downloadonly fail
Pirut doesn't call doPluginSetup() properly, so plugins like yum-downloadonly...
Status: CLOSED DUPLICATE of bug 191630
Product: Fedora
Classification: Fedora
Component: pirut (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Seth Vidal
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-23 08:37 EDT by Johnny Miller
Modified: 2014-01-21 17:54 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-08-10 15:10:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Crashdump file (1.17 KB, application/octet-stream)
2006-07-23 08:37 EDT, Johnny Miller
no flags Details

  None (edit)
Description Johnny Miller 2006-07-23 08:37:44 EDT
Description of problem:
Since I instlled yum I have been unable to update my software.  I keep getting a
error report.  I have included both files for your review.


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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Johnny Miller 2006-07-23 08:37:44 EDT
Created attachment 132882 [details]
Crashdump file
Comment 2 David Lawrence 2007-08-08 16:39:15 EDT
Reassigning to yum component.
Comment 3 James Antill 2007-08-08 17:03:46 EDT
Pasting the traceback:


Traceback (most recent call last):
  File "/usr/sbin/pirut", line 363, in ?
    main()
  File "/usr/sbin/pirut", line 358, in main
    pm = PackageManager()
  File "/usr/sbin/pirut", line 56, in __init__
    GraphicalYumBase.__init__(self, False)
  File "/usr/lib/python2.4/site-packages/pirut/__init__.py", line 123, in __init__
    self.doPluginSetup(types=(yum.plugins.TYPE_CORE))
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 173, in
doPluginSetup
    optparser, types)
  File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 148, in __init__
    self.run('config')
  File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 164, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/downloadonly.py", line 26, in config_hook
    parser.add_option('', '--downloadonly', dest='dlonly', action='store_true',
AttributeError: 'NoneType' object has no attribute 'add_option'

Local variables in innermost frame:
conduit: <yum.plugins.ConfigPluginConduit instance at 0xb798a6cc>
parser: None


...reassigning to pirut, looks like it isn't doing:

self.optparser = YumOptionParser(...)

...before calling the plugin init code.
 On the other hand given it's pretty much guaranteed noone wants to use
downloadonly with pirut, maybe we should fix the plugins so that they can say
"only run me when running via. yum cli"?
Comment 4 James Antill 2007-08-08 17:06:07 EDT
 To the original poster, you can have your software updates work again by doing:

rpm -e yum-downloadonly

...as root.
Comment 5 Jeremy Katz 2007-08-09 09:59:58 EDT
(In reply to comment #3)
> ...reassigning to pirut, looks like it isn't doing: 
> self.optparser = YumOptionParser(...)

That's not guaranteed to be done outside of the cli

> ...before calling the plugin init code.
>  On the other hand given it's pretty much guaranteed noone wants to use
> downloadonly with pirut, maybe we should fix the plugins so that they can say
> "only run me when running via. yum cli"?

Yeah, sounds like the plugin should either 
a) check for having an optparser, or
b) be of TYPE_INTERACTIVE
Comment 6 James Antill 2007-08-09 10:55:19 EDT
 Hmm, git annotate on downloadonly gives:

820d0a0e        (Tim Lauridisen 2006-10-05 13:33:23 +0000       22)plugin_type =
 (TYPE_INTERACTIVE,)

...Ahh HA, I think I understand, pirut does:

    self.doPluginSetup(types=(yum.plugins.TYPE_CORE))

...instead of:

    self.doPluginSetup(types=(yum.plugins.TYPE_CORE,))

...so types == TYPE_CORE == 0, so this bit of code runs:

        if not types:
            types = ALL_TYPES

...Doh!
Comment 7 Jeremy Katz 2007-08-10 15:10:41 EDT

*** This bug has been marked as a duplicate of 191630 ***

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