Bug 757736 - 'yum history rollback XXXX' fails: "AttributeError: YumHistory instance has no attribute 'split'"
Summary: 'yum history rollback XXXX' fails: "AttributeError: YumHistory instance has n...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: rawhide
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Seth Vidal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-28 14:57 UTC by Tom London
Modified: 2014-01-21 23:20 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-07 16:54:27 UTC
Type: ---


Attachments (Terms of Use)

Description Tom London 2011-11-28 14:57:14 UTC
Description of problem:
This happens every time I try to rollback with 'yum history rollback 2009':

Loaded plugins: auto-update-debuginfo, presto, refresh-packagekit
Rollback to transaction 2009, from Tue Nov 22 08:31:44 2011
  Undoing the following transactions: 2010, 2011, 2012, 2013, 2014, 2015, 2016,
                                    : 2017, 2018, 2019, 2020, 2021, 2022, 2023
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 315, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 140, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 483, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 2548, in doCommand
    ret = self._hcmd_rollback(base, extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 2447, in _hcmd_rollback
    base.historyInfoCmdPkgsAltered(mobj)
  File "/usr/share/yum-cli/output.py", line 2257, in historyInfoCmdPkgsAltered
    for hpkg in old.trans_data:
  File "/usr/lib/python2.7/site-packages/yum/history.py", line 307, in <lambda>
    trans_data = property(fget=lambda self: self._getTransData())
  File "/usr/lib/python2.7/site-packages/yum/history.py", line 590, in _getTransData
    _move_pkg_f(xfpkg, nfstate)
  File "/usr/lib/python2.7/site-packages/yum/history.py", line 459, in _move_pkg_f
    self._move_pkg(sk, nstate, fpkgtup2pkg, fpkgstate2pkg)
  File "/usr/lib/python2.7/site-packages/yum/history.py", line 449, in _move_pkg
    xpkg = self._conv_pkg_state(xpkg, nstate)
  File "/usr/lib/python2.7/site-packages/yum/history.py", line 429, in _conv_pkg_state
    pkg._history)
  File "/usr/lib/python2.7/site-packages/yum/history.py", line 220, in __init__
    checksum, history)
  File "/usr/lib/python2.7/site-packages/yum/history.py", line 162, in __init__
    chk = checksum.split(':')
AttributeError: YumHistory instance has no attribute 'split'

Version-Release number of selected component (if applicable):
yum-3.4.3-11.fc17.noarch

How reproducible:
every time

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


Expected results:


Additional info:

Comment 1 Tom London 2011-12-01 15:07:15 UTC
Downgrading to yum-3.4.3-5.fc17.noarch appears to make 'rollback' more functional.

I tried all the yum packages between -11 and -5 (that I could find in my cache dirs) and -5 was the first one to 'work'.

Comment 2 James Antill 2011-12-01 18:10:06 UTC
Here is the upstream fix:

commit 2216e1a8d352718e92ebb14ff57f9635d960c29c
Author: James Antill <james>
Date:   Thu Dec 1 13:09:29 2011 -0500

    Fix _conv_pkg_state when calling with history as checksum. BZ 757736.

diff --git a/yum/history.py b/yum/history.py
index d27fa44..0a29059 100644
--- a/yum/history.py
+++ b/yum/history.py
@@ -426,7 +426,7 @@ class YumMergedHistoryTransaction(YumHistoryTransaction):
     def _conv_pkg_state(pkg, state):
         npkg = YumHistoryPackageState(pkg.name, pkg.arch,
                                       pkg.epoch,pkg.version,pkg.release, state,
-                                      pkg._history)
+                                      history=pkg._history)
         npkg._checksums = pkg._checksums
         npkg.done = pkg.done
         if _sttxt2stcode[npkg.state] in TS_INSTALL_STATES:

Comment 3 Tom London 2011-12-02 14:27:54 UTC
I can confirm that with this change, -11 "works for me".

Thanks.

Comment 4 Tom London 2011-12-03 20:08:03 UTC
Seems to work with yum-3.4.3-15.fc17.noarch


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