Bug 190602 - rhnpush errors for --list option when run without --channel option
Summary: rhnpush errors for --list option when run without --channel option
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Other
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Pradeep Kilambi
QA Contact: wes hayutin
URL:
Whiteboard:
Depends On:
Blocks: 166615
TreeView+ depends on / blocked
 
Reported: 2006-05-03 20:36 UTC by Pradeep Kilambi
Modified: 2009-03-24 16:44 UTC (History)
1 user (show)

Fixed In Version: rhn500h
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-03-24 16:44:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Pradeep Kilambi 2006-05-03 20:36:38 UTC
Description of problem:
rhnpush errors of with the following error message when we try to use --list
option without the channel label. Although it is doing the right thing by
throwing an error its making an unnecessary xml-rpc call to check for listing
the channels even though the channel label is not specified.

How reproducible: Always for --list without --channel

Steps to Reproduce:

[root@rlx-2-08 ~]# rhnpush --verbose --list --username=admin --password=dog8code
--server=http://rlx-2-08.rhndev.redhat.com Connecting to
http://rlx-2-08.rhndev.redhat.com/APP
Error Message:
     You are not allowed to manage channel , or that channel does not exist
 Error Class Code: 32
 Error Class Info: Channel error
 Explanation:
      An error has occurred while processing your request. If this problem
      persists please enter a bug report at bugzilla.redhat.com.
      If you choose to submit the bug report, please be sure to include
      details of what you were trying to do when this error occurred and
      details on how to reproduce this problem.
Version-Release number of selected component (if applicable):

Possible Solution:

if --list is specified --channel should be made a mandatory option and should
not processed to the rpc call unless both --list annd --channel options are
given.This way we can avoid unnecessary calls if required inputs are not given.

Comment 1 Bret McMillan 2006-09-05 17:57:20 UTC
yeah, the opt-parsing on that seems quite screwed up.  moving to rhn420-must

Comment 2 Pradeep Kilambi 2006-09-06 20:19:08 UTC
when a channel option is specified rhnpush_confmanager creates the
options.channel with something like this:
self.defaultconfig.channel = map(string.strip,
string.split(self.defaultconfig.channel, ','))

that is if --channel=A,B we get ['A', 'B'] but if no channel option is specified
we get ['']. which is a list of size 1. hence the check 
"if not options.channel" fails and thinks that there is a channel even though
there is not and continues the call to the server.

This is true for --newest flag a well. 
   [root@prad pkilambi]# rhnpush --server=rlx-0-20.rhndev.redhat.com
--username=admin --password=dog8code --newest

Error Message:
    You are not allowed to manage channel , or that channel does not exist
Error Class Code: 32
Error Class Info: Channel error
Explanation:
     An error has occurred while processing your request. If this problem
     persists please enter a bug report at bugzilla.redhat.com.
     If you choose to submit the bug report, please be sure to include
     details of what you were trying to do when this error occurred and
     details on how to reproduce this problem.

where --channel is mandatory for --newest. There is a check for the channel
option but it fails due to the way we return the empty channel list of size 1.

fix is to assign a null array to the option.channel when no --channel is specified.
if not self.defaultconfig.channel:
            #if no channel then make it null array instead of
            #an empty string array from of size 1 [''] .
            self.defaultconfig.channel = []
        else:
            self.defaultconfig.channel = map(string.strip,
string.split(self.defaultconfig.channel, ','))
        
That way it behaves as expected:

[pkilambi@prad pkilambi]# rhnpush --server=rlx-0-20.rhndev.redhat.com
--username=admin --password=dog8code --list
Must specify a channel for --list to list channels

[pkilambi@prad pkilambi]# rhnpush --server=rlx-0-20.rhndev.redhat.com
--username=admin --password=dog8code --newest

Must specify a channel for --newest to work



Comment 3 wes hayutin 2007-01-26 17:45:24 UTC
the errors for the above look good..
however I'm not sure about the following...

[root@whayutin ~]#  PYTHONPATH='/usr/share/rhn' python /usr/bin/rhnpush
--server=fjs-0.06.rhndev.redhat.com --username=whayutin --password=redhat 
--newest -crhel-i386-es-4

ERROR: unhandled exception occurred: ((-2, 'Name or service not known')).
[root@whayutin ~]#  PYTHONPATH='/usr/share/rhn' python /usr/bin/rhnpush
--server=fjs-0.06.rhndev.redhat.com --username=whayutin --password=redhat 
--list -crhel-i386-es-4

ERROR: unhandled exception occurred: ((-2, 'Name or service not known')).

[root@whayutin ~]# rpm -qa | grep rhnpush
rhnpush-5.0.0-3



Comment 4 Pradeep Kilambi 2007-01-26 19:56:52 UTC
yep we need a better error message here, although the problem here is your
server name is unresolvable, try fjs-0-06 instead of fjs-0.06

Comment 5 wes hayutin 2007-01-29 19:45:47 UTC
oh man... thanks..
Ok.. got this working..

[whayutin@whayutin tmp]$ PYTHONPATH='/usr/share/rhn' python /usr/bin/rhnpush
--server=fjs-0-06.rhndev.redhat.com --username=whayutin --password=redhat 
-cwesleyd VMware-console-3.1.0-9089.i386.rpm --nosig

the above problem w/ the error is fixed.. closing the bug...
I'll open a new bug to track "Name or service not known" error message so its
more clear... low priority I'm sure..

thanks

Comment 6 wes hayutin 2007-03-10 03:03:52 UTC
need a working satellite in stage to verify this.. but we're having cert problems.

Comment 7 Brandon Perkins 2007-03-13 14:18:58 UTC
Closed in rhn500h Release.

Comment 8 Brandon Perkins 2007-03-13 17:55:43 UTC
Closed in rhn500h release.

Comment 9 Brandon Perkins 2007-03-13 20:38:44 UTC
Closed in rhn500h Release.

Comment 10 Brandon Perkins 2007-03-13 20:55:32 UTC
Closed in rhn500h Release.


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