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.
yeah, the opt-parsing on that seems quite screwed up. moving to rhn420-must
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
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
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
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
need a working satellite in stage to verify this.. but we're having cert problems.
Closed in rhn500h Release.
Closed in rhn500h release.