Bug 698579

Summary: "spacewalk-channel" exit code is always 0 even when it fails.
Product: Red Hat Satellite 5 Reporter: Dimitar Yordanov <dyordano>
Component: ServerAssignee: Tomas Lestach <tlestach>
Status: CLOSED DEFERRED QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 541CC: cperry, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-04 13:28:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 462714    

Description Dimitar Yordanov 2011-04-21 09:48:46 UTC
Description of problem:
"spacewalk-channel" exit code is always 0 even when it fails.

Version-Release number of selected component (if applicable):
rhn-setup-0.4.20-46.el5

How reproducible:
Always

Steps to Reproduce:
1.Get RHEL5 system
2.Register to Satellite
3.spacewalk-channel --list
rhel-i386-server-5
4. Try to unsubscribe from a channel that it not in the list above.
spacewalk-channel -r -u ${USER} -p ${PASS} -c rhn-tools-rhel-i386-server-6
6. No error,info or  warning message.
5. echo $?  
Actual results:
0

Expected results:
1, 127 ... etc.

Additional info:
Many other inappropriate error messages.

Examples:
#### In case -a (-r) parameter is omitted. ###
[root@dell~]# spacewalk-channel -u admin -p admin -c rhn-tools-rhel-i386-server-6
Traceback (most recent call last):
  File "/usr/sbin/spacewalk-channel", line 92, in ?
    main()
  File "/usr/sbin/spacewalk-channel", line 86, in main
    s = rhnserver.RhnServer()
NameError: global name 'rhnserver' is not defined

The Error message is misleading.


#### Execute without params ####

[root@dell ~]# spacewalk-channel
ERROR: username is required

Does not say much as well. ( --list option does not need username and password)

Comment 1 Tomas Lestach 2011-10-05 14:27:33 UTC
Return code of up2date.unsubscribeChannels backend xmlrpc API is a matter of the RHN Satellite server.

Changing product of the BZ to RHN Satellite.