Bug 1436644 - spacecmd misleading error message: "Can't call softwarechannel_{g,s}etorgaccesstree on child channel"
Summary: spacecmd misleading error message: "Can't call softwarechannel_{g,s}etorgacce...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server
Version: 580
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Tomáš Kašpárek
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks: sat580-low
TreeView+ depends on / blocked
 
Reported: 2017-03-28 11:26 UTC by Lukáš Hellebrandt
Modified: 2017-06-21 12:11 UTC (History)
1 user (show)

Fixed In Version: spacecmd-2.5.0-12-sat
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-21 12:11:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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: [...]


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