Bug 470612 - yum-complete-transaction fails with global name 'os' is not defined.
yum-complete-transaction fails with global name 'os' is not defined.
Status: CLOSED DUPLICATE of bug 470458
Product: Fedora
Classification: Fedora
Component: yum-utils (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Seth Vidal
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-07 18:28 EST by Walter Francis
Modified: 2014-01-21 18:06 EST (History)
3 users (show)

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


Attachments (Terms of Use)

  None (edit)
Description Walter Francis 2008-11-07 18:28:05 EST
Description of problem:

In the current rawhide (11/07/08) updated to from the F10 pre-release, I had a yum transaction that seems to have not completed, yum alerted me to the fact.  So running yum-complete-transaction seems to do some work, but eventually fails in this fashion:

# yum-complete-transaction --cleanup-only
Loaded plugins: refresh-packagekit
Cleaning up unfinished transaction journals
Cleaning up 2008-02-03.10:26.42
Traceback (most recent call last):
  File "/usr/sbin/yum-complete-transaction", line 208, in <module>
    util = YumCompleteTransaction()
  File "/usr/sbin/yum-complete-transaction", line 115, in __init__
    self.main()
  File "/usr/sbin/yum-complete-transaction", line 163, in main
    self.clean_up_ts_files(timestamp, self.conf.persistdir)
  File "/usr/sbin/yum-complete-transaction", line 123, in clean_up_ts_files
    if os.path.exists(f):
NameError: global name 'os' is not defined

I have done --cleanup-only to avoid the long process of waiting for it to do transactional work, the result is the same.

The actual work to be done by the transaction might have actually completed, I think it's just failing to clean up after itself.  The original transaction had work to do for atmel-firmware and now I only see a single copy of the latest package installed.  I would expect to see an older version or two versions installed with outstanding transactions.

How reproducible:  100%

Steps to Reproduce:
1. Get an incomplete yum transaction
2. Attempt yum-complete-transaction
  
Actual results:

Fails with above result.

Expected results:

The transaction would complete, or clean-up as instructed.

Additional info:

Noted on two different installs, both i386 32 bit installs, one from F10 Snap 2 upgraded along the path until now, and another machine just recently installed F10 Pre-release and upgraded.
Comment 1 Walter Francis 2008-11-07 20:34:08 EST
Suggested test fro mutk on #fedora was to add "import os" to the yum-complete-transaction script near the top and that fixes it.

Not sure that's the proper patch, given there are some branches in the script, but that fixes the error.
Comment 2 seth vidal 2008-11-08 01:10:39 EST

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

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