Bug 199863 - Pirut doesn't call doPluginSetup() properly, so plugins like yum-downloadonly fail
Summary: Pirut doesn't call doPluginSetup() properly, so plugins like yum-downloadonly...
Keywords:
Status: CLOSED DUPLICATE of bug 191630
Alias: None
Product: Fedora
Classification: Fedora
Component: pirut
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Seth Vidal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-07-23 12:37 UTC by Johnny Miller
Modified: 2014-01-21 22:54 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-08-10 19:10:41 UTC
Type: ---
Embargoed:


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

Description Johnny Miller 2006-07-23 12:37:44 UTC
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 12:37:44 UTC
Created attachment 132882 [details]
Crashdump file

Comment 2 David Lawrence 2007-08-08 20:39:15 UTC
Reassigning to yum component.

Comment 3 James Antill 2007-08-08 21:03:46 UTC
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 21:06:07 UTC
 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 13:59:58 UTC
(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 14:55:19 UTC
 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 19:10:41 UTC

*** 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.