Bug 651598 - yum-plugin-priorities is broken in rawhide
yum-plugin-priorities is broken in rawhide
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: yum-utils (Show other bugs)
rawhide
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Seth Vidal
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-11-09 16:24 EST by Deepak Bhole
Modified: 2014-01-21 18:16 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-11-09 16:38:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Deepak Bhole 2010-11-09 16:24:00 EST
Hi. I have yum-plugin-priorities-1.1.29-2.fc15.noarch.rpm (latest in rawhide) installed and running any yum command with it installed results in a traceback, making yum unusable:

# yum update
Loaded plugins: langpacks, presto, priorities, refresh-packagekit
Adding en_US to language list
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 260, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 115, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 412, in doCommands
    self._getTs(needTsRemove)
  File "/usr/lib/python2.7/site-packages/yum/depsolve.py", line 99, in _getTs
    self._getTsInfo(remove_only)
  File "/usr/lib/python2.7/site-packages/yum/depsolve.py", line 110, in _getTsInfo
    pkgSack = self.pkgSack
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 828, in <lambda>
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 631, in _getSacks
    self.plugins.run('exclude')
  File "/usr/lib/python2.7/site-packages/yum/plugins.py", line 184, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/priorities.py", line 110, in exclude_hook
    if check_obsoletes and not conduit._base.conf.obsoletes:
UnboundLocalError: local variable 'check_obsoletes' referenced before assignment

I have priority set in only one repo config:

# cat /etc/yum.repos.d/rawhide-local.repo 
[rawhide-local]
name=rawhide-local
baseurl=<REDACTED>
enabled=1
gpgcheck=0
priority=1
Comment 1 seth vidal 2010-11-09 16:31:52 EST
If you modify the priorities plugin

diff --git a/plugins/priorities/priorities.py b/plugins/priorities/priorities.py
index ff1a4ed..202c203 100644
--- a/plugins/priorities/priorities.py
+++ b/plugins/priorities/priorities.py
@@ -94,6 +94,7 @@ def _all_repo_priorities_same(allrepos):
 
 def exclude_hook(conduit):
     global only_samearch
+    global check_obsoletes
 
     allrepos = conduit.getRepos().listEnabled()
 


does that fix it?
Comment 2 Deepak Bhole 2010-11-09 16:35:01 EST
Yep, that worked!
Comment 3 seth vidal 2010-11-09 16:37:29 EST
great - pushed upstream
thanks
Comment 4 Deepak Bhole 2010-11-09 16:38:59 EST
Awesome, thanks!

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