Bug 138437 - TypeError: runTransaction() takes at least 4 arguments (2 given)
Summary: TypeError: runTransaction() takes at least 4 arguments (2 given)
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: up2date
Version: 4.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Adrian Likins
QA Contact: Ken Reilly
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-11-09 10:20 UTC by Stephen
Modified: 2009-11-13 16:10 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-11-13 16:10:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Stephen 2004-11-09 10:20:32 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)
Gecko/20040922 Epiphany/1.2.7

Description of problem:
RPMs can not be removed from a machine via a scheduled action from the
RHN service.  Looks like an error in up2date.

rhn_check -vvv produces a stack trace (see below).

I tried scheduling both 1 and 2 pkgs at the same time for deletion.


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

How reproducible:
Always

Steps to Reproduce:
1. Schedule a package to be removed from RHN
2. sudo /usr/sbin/rhn_check -vvv



Actual Results:  Python traceback:

D: do_call packages.remove ([['xsnow', '1.42', '14']],)
D: Called remove_packages [['xsnow', '1.42', '14']]
Traceback (most recent call last):
  File "/usr/sbin/rhn_check", line 166, in run_action
    (status, message, data) = do_call(method, params)
  File "/usr/sbin/rhn_check", line 94, in do_call
    retval = apply(method, params)
  File "/usr/share/rhn/actions/packages.py", line 83, in remove
    up2date.removePackages(pkgList, rpmCallback)
  File "/usr/share/rhn/up2date_client/up2date.py", line 971, in
removePackages
    runTransaction(ts,rpmCallback)
TypeError: runTransaction() takes at least 4 arguments (2 given)
D: Sending back response ((6,), 'Fatal error in Python code occured', {})
D: do_call packages.checkNeedUpdate ('rhnsd=1',)
D: local action status:  (0, 'rpm database not modified since last
update (or package list recently updated)', {})


Expected Results:  The package should have been removed.

Additional info:

Sure enough, the function runTransaction defined in
/usr/share/rhn/up2date_client/up2date.py has 4 required arguments:

def runTransaction(ts, added, removed, rpmCallback, transdir=None,
rollbacktrans=1):

But on line 971 is called with only 2:

runTransaction(ts,rpmCallback)

Comment 1 Michael Pearson 2005-02-20 23:26:33 UTC
This bug also applies to RHEL-ES-4-x86_64, which surprises me somewhat, seeing
as it's so simple.

What's happening is Python is confusing the two versions of the "runTransaction"
method: one which expects two arguments and lives in rpmUtils.py, and one which
expects four arguments and lives in up2date.py. 

Removing packages isn't a critical thing for us at the moment, so I'm not able
to devote work time to writing a patch, although anybody with enough python
skill should be able to knock one up fairly quickly.

Comment 2 Matthew Miller 2005-04-26 16:26:29 UTC
Fedora Core 2 is now maintained by the Fedora Legacy project for
security updates only. If this problem is a security issue, please
reopen and reassign to the Fedora Legacy product. If it is not a
security issue and hasn't been resolved in the current FC3 updates or
in the FC4 test release, reopen and change the version to match.

Comment 3 David Lawrence 2006-04-18 20:21:20 UTC
NEEDINFO_ENG has been deprecated in favor of NEEDINFO or ASSIGNED. Changing
status to ASSIGNED for ENG review.

Comment 4 John Thacker 2006-04-22 15:20:16 UTC
Moving to RHEL4 since it apparently occurs there, and up2date is no longer
shipped in Fedora Core.


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