Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 666410

Summary: 'rhn-channel' command fails with a traceback.
Product: Red Hat Enterprise Linux 6 Reporter: Vimal Kumar <vikumar>
Component: rhn-client-toolsAssignee: Milan Zázrivec <mzazrivec>
Status: CLOSED DUPLICATE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: slukasik
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-02 11:45:52 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:
Attachments:
Description Flags
Patched '/usr/sbin/rhn-channel' python script none

Description Vimal Kumar 2010-12-30 15:05:48 UTC
Created attachment 471197 [details]
Patched '/usr/sbin/rhn-channel' python script

1 ) Description of problem:

'rhn-channel' command fails with a traceback when executed either with 'username/password' as arguments or without any arguments. The traceback is as follows :

<snip>
rhn-channel:92:main:NameError: global name 'rhnserver' is not defined

Traceback (most recent call last):
  File "/usr/sbin/rhn-channel", line 98, in <module>
    main()
  File "/usr/sbin/rhn-channel", line 92, in main
    s = rhnserver.RhnServer()
NameError: global name 'rhnserver' is not defined

Local variables in innermost frame:
</snip>

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

<snip>
# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.0 (Santiago)
# rpm -qf `which rhn-channel`
rhn-setup-1.0.0-39.el6.noarch
</snip>

3 ) How reproducible:

Reproducible every time 'rhn-channel' is executed.

4 ) Steps to Reproduce:

 a. Execute the command 'rhn-channel' either with '-u <USERNAME> -p <PASSWORD>' or without any arguments.

 b. It tracebacks in both cases :

<snip>
(First try, without arguments)

# rhn-channel 
Username: admin
Password: ******

Traceback (most recent call last):
  File "/usr/sbin/rhn-channel", line 103, in <module>
    main()
  File "/usr/sbin/rhn-channel", line 97, in main
    s = rhnserver.RhnServer()
NameError: global name 'rhnserver' is not defined

---------

(Second try, with arguments)

# rhn-channel -u admin -p redhat
Traceback (most recent call last):
  File "/usr/sbin/rhn-channel", line 103, in <module>
    main()
  File "/usr/sbin/rhn-channel", line 97, in main
    s = rhnserver.RhnServer()
NameError: global name 'rhnserver' is not defined
</snip>

5 ) Expected results:

The command 'rhn-channel' should return a list of lists of packages with their major/minor versions as shown below :

# rhn-channel -u admin -p redhat
[['ConsoleKit', '0.4.1', '3.el6', ''], ['ConsoleKit-libs', '0.4.1', '3.el6', ''], ['ConsoleKit-x11', '0.4.1', '3.el6', ''], ['DeviceKit-power', '014', '1.el6', ''], ['ElectricFence', '2.2.2', '28.el6', ''], ['GConf2', '2.28.0', '6.el6', ''], ['GConf2-devel', '2.28.0', '6.el6', ''], ['GConf2-gtk', '2.28.0', '6.el6', ''], ['ImageMagick', '6.5.4.7', '5.el6', ''], ['ImageMagick-c++', '6.5.4.7', '5.el6', ''], ['MAKEDEV', '3.24', '6.el6', ''], ['ModemManager', '0.4.0', '3.git20100628.el6', ''], ['MySQL-python', '1.2.3', '0.3.c1.1.el6', ''], ['NetworkManager', '0.8.1', '5.el6_0.1', '1'], ['NetworkManager-glib', '0.8.1', '5.el6_0.1', '1'], ['NetworkManager-gnome', '0.8.1', '5.el6_0.1', '1'], ['NetworkManager-openswan', '0.8.0', '5.20100411git.el6', ''], ['ORBit2', '2.14.17', '3.1.el6', ''], ['ORBit2-devel', '2.14.17', '3.1.el6', ''], ['OpenEXR-libs', '1.6.1', '8.1.el6', '']....
..]

-------

Note: 

A patched '/usr/sbin/rhn-channel' file is attached along with this bugzilla. The diff output is below :

<snip>
# diff -pruN  /usr/sbin/rhn-channel.orig /usr/sbin/rhn-channel
--- /usr/sbin/rhn-channel.orig	2010-12-30 20:34:05.063200320 +0530
+++ /usr/sbin/rhn-channel	2010-12-30 20:34:38.526202320 +0530
@@ -17,6 +17,10 @@ import os
 import socket
 import sys
 import getpass
+import sys
+
+sys.path.append('/usr/share/rhn/up2date_client/')
+import rhnserver
 
 from optparse import Option, OptionParser
</snip>

Regards,

Vimal

Comment 5 Milan Zázrivec 2011-01-02 11:45:52 UTC

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