Bug 1436644

Summary: spacecmd misleading error message: "Can't call softwarechannel_{g,s}etorgaccesstree on child channel"
Product: Red Hat Satellite 5 Reporter: Lukáš Hellebrandt <lhellebr>
Component: ServerAssignee: Tomáš Kašpárek <tkasparek>
Status: CLOSED CURRENTRELEASE QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: low Docs Contact:
Priority: unspecified    
Version: 580CC: tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacecmd-2.5.0-12-sat Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-21 12:11:54 UTC Type: Bug
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: 1358815    

Description Lukáš Hellebrandt 2017-03-28 11:26:54 UTC
Description of problem:
When calling softwarechannel_setorgaccesstree or softwarechannel_getorgaccesstree on a nonexistent channel, the following error is shown:

"ERROR: Can't call softwarechannel_setorgaccesstree on child channel!"
or
"ERROR: Can't call softwarechannel_getorgaccesstree on child channel!"

This error does not reflect what really happened.

How reproducible:
Deterministic

Steps to Reproduce:
1. Have a satellite without software channel $CHANNEL
2. # spacecmd -- softwarechannel_getorgaccesstree $CHANNEL

Actual results:
Error message

Expected results:
No error message, access rights of the channel shown (or set, respectively)

Additional info:
Merely changing an error message to include both possibilities (channel does not exist or is not a base channel) should be sufficient. Will provide patch.

Comment 1 Lukáš Hellebrandt 2017-04-11 11:46:11 UTC
Pull request https://github.com/spacewalkproject/spacewalk/pull/535 . Additionally fixed the same issue in softwarechannel_clonetree.

Comment 2 Tomáš Kašpárek 2017-04-11 12:32:43 UTC
PR accepted: spacewalk.git(master): 75d53343c54a8289d2a757be8e29fd19c98482d2

Comment 5 Lukáš Hellebrandt 2017-04-12 13:39:06 UTC
Verified with spacecmd-2.5.0-12 .


# spacecmd -- softwarechannel_getorgaccesstree "nonexistentchannel"
INFO: Connected to https://<URL>/rpc/api as admin
ERROR: Channel does not exist or is not a base channel!
softwarechannel_getorgaccesstree: Get the org-access for a software base channel and its children
usage: softwarechannel_getorgaccesstree [CHANNEL]

# spacecmd -- softwarechannel_setorgaccesstree -d "nonexistentchannel"
INFO: Connected to https://<URL>/rpc/api as admin
ERROR: Channel does not exist or is not a base channel!
softwarechannel_setorgaccesstree: set the org-access for a software base channel and its children
usage: [...]

# spacecmd -- softwarechannel_clonetree -s nonexistentchannel -p pr-
INFO: Connected to https://kvm-02-guest01.rhts.eng.bos.redhat.com/rpc/api as admin
ERROR: Channel does not exist or is not a base channel!
softwarechannel_clonetree: Clone a software channel and its child channels
usage: [...]