Bug 682887 - Python traceback when running rhn_package_manager with -s option
Summary: Python traceback when running rhn_package_manager with -s option
Keywords:
Status: CLOSED DUPLICATE of bug 677775
Alias: None
Product: Red Hat Satellite Proxy 5
Classification: Red Hat
Component: Server
Version: 540
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: sat541-triage
TreeView+ depends on / blocked
 
Reported: 2011-03-07 21:51 UTC by Tasos Papaioannou
Modified: 2018-11-14 15:06 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-05 08:21:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Tasos Papaioannou 2011-03-07 21:51:42 UTC
Description of problem:

On a Proxy 5.4 activated on Red Hat Network Hosted, run rhn_package_manager with the -s (sync) option against a custom channel. The following traceback results:

# rhn_package_manager -s -c <channel-label> -vvv
Channels: <channel-label>
Red Hat Network username: <rhn login>
Red Hat Network password: <password>
Connecting to https://xmlrpc.rhn.redhat.com/XP
Traceback (most recent call last):
  File "/usr/bin/rhn_package_manager", line 28, in ?
    rhn_package_manager.main()
  File "/usr/share/rhn/PackageManager/rhn_package_manager.py", line 100, in main
    upload.checkSync()
  File "/usr/share/rhn/PackageManager/rhn_package_manager.py", line 174, in checkSync
    list = uploadLib.listChannel(self.server, self.username, self.password,
AttributeError: 'module' object has no attribute 'listChannel'

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




How reproducible:

100%

Steps to Reproduce:
1. Activate Proxy 5.4 on RHN Hosted.
2. Attempt to run rhn_package_manager in sync mode (same traceback error results regardless of whether the channel or login credentials are valid:

# rhn_package_manager -c test-channel -s
Red Hat Network username: rhn-login
Red Hat Network password: <password>

3. See above traceback error.
  
Actual results:

Above traceback error.

Expected results:

No traceback, diff output of channel on RHN with current directory.

Additional info:

Error is due to uploadLib.listChannel not being imported by rhn_package_manager.py. After making the following changes to /usr/share/rhn/PackageManager/rhn_package_manager.py, I was able to run the -s / --sync option successfully.

***
# diff -pruN rhn_package_manager.py rhn_package_manager_test.py

--- rhn_package_manager.py	2011-01-21 17:41:38.000000000 -0500
+++ rhn_package_manager_test.py	2011-01-21 17:40:20.000000000 -0500
@@ -39,6 +39,7 @@ import shutil
 from types import IntType, StringType
 from operator import truth
 from rhnpush.uploadLib import UploadError
+from rhnpush.uploadLib import listChannel
 try:
     from optparse import Option, OptionParser
 except ImportError:
@@ -171,7 +172,8 @@ class UploadClass(uploadLib.UploadClass)
         self.setServer()
 	
         # List the channel's contents
-        list = uploadLib.listChannel(self.server, self.username, self.password, self.channels)
+        # list = uploadLib.listChannel(self.server, self.username, self.password, self.channels)
+        list = listChannel(self.server, self.username, self.password, self.channels)
 
         # Convert it to a hash of hashes
         remotePackages = {}

***

Comment 1 Miroslav Suchý 2011-05-05 08:21:09 UTC

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


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