Bug 682887

Summary: Python traceback when running rhn_package_manager with -s option
Product: Red Hat Satellite Proxy 5 Reporter: Tasos Papaioannou <tpapaioa>
Component: ServerAssignee: Miroslav Suchý <msuchy>
Status: CLOSED DUPLICATE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 540CC: cperry, jwest
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-05 08:21:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 677498    

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 ***