| Summary: | Cannot set a service level for a consumer that is not available to its organization. | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | John Sefler <jsefler> |
| Component: | subscription-manager | Assignee: | Devan Goodwin <dgoodwin> |
| Status: | CLOSED ERRATA | QA Contact: | Entitlement Bugs <entitlement-bugs> |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.3 | CC: | dgoodwin |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-06-20 13:06:00 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: | 738066 | ||
|
Description
John Sefler
2012-02-21 14:58:57 UTC
[root@jsefler-r63-server ~]# subscription-manager register --username testuser1 --password password --org admin --servicelevel foo --autosubscribe --force The system with UUID 0f8e7036-547e-46f5-b408-e19abefd97d4 has been unregistered The system has been registered with id: b68a8ef3-25a1-439b-ab8a-efa9964ca1b5 Cannot set a service level for a consumer that is not available to its organization. [root@jsefler-r63-server ~]# echo $? 255 [root@jsefler-r63-server ~]# subscription-manager identity Current identity is: b68a8ef3-25a1-439b-ab8a-efa9964ca1b5 name: jsefler-r63-server.usersys.redhat.com org name: Admin Owner org id: 8a90f814359d70fa01359d713c6b0007 [root@jsefler-r63-server ~]# I also believe that the 255 exit code is too extreme since the primary operation (register) actually succeeded, the secondary operation (autosubscribe) was aborted, and the option (servicelevel) failed. As detailed in bug 689608, an exit code of 0 is used to indicate that at least one autosubscribe bind occurred, and an exit code of 1 is used to indicate that no binds occurred. In this case I suggest a new exit code of 2 be returned to indicate the servicelevel setting failed. [root@jsefler-r63-server ~]# subscription-manager subscribe --auto --servicelevel FOO Cannot set a service level for a consumer that is not available to its organization. [root@jsefler-r63-server ~]# echo $? 255 ^^^ Following the same arguments in comment 1, I think the exit code for this subscribe attempt should also be 2 instead of 255. I think BK got the message changed already in b302e16f. Have discussed with the team and we're hesitant to make the error code change. The CLI is not designed for fine grained error handling today, all of our exits are either 1 or -1 (255), and this is just inconsistency, they have no specific meanings. Having 2 mean SLA couldn't be set may not be a great idea if every other possible error is 1 or 255. As per the linked bug, 1 does get returned if no bind could be done Going to move to modified for the string change. If the error code is a major issue for any reason then we can discuss and reopen accordingly, but ideally if fine grained error handling via exit codes is required, we should probably plan it out and implement it consistently. Verifying Version.... [root@jsefler-r63-server ~]# rpm -q subscription-manager subscription-manager-0.99.12-1.git.1.2b349d3.el6.x86_64 [root@jsefler-r63-server ~]# subscription-manager register --username testuser1 --password password --org admin --servicelevel foo --autosubscribe --force The system has been registered with id: 3b2b5b52-da7a-4dee-9a51-6271cb01a17e Service level foo is not available to consumers of organization admin. [root@jsefler-r63-server ~]# echo $? 255 [root@jsefler-r63-server ~]# subscription-manager identity Current identity is: 3b2b5b52-da7a-4dee-9a51-6271cb01a17e name: jsefler-r63-server.usersys.redhat.com org name: Admin Owner org id: 8a90f81436542b200136542b439f0007 ^^^ NOTE THAT THE SYSTEM WAS SUCCESSFULLY REGISTERED DESPITE THE 255 EXIT CODE [root@jsefler-r63-server ~]# subscription-manager subscribe --auto --servicelevel foo Service level foo is not available to consumers of organization admin. [root@jsefler-r63-server ~]# echo $? 255 ^^^ THIS EXIT CODE SEEMS REASONABLE SINCE THE AUTOSUBSCRIBE ATTEMPT FAILED VERIFIED: The error message was clarified for the unavailable service level. VERIFIED: Despite a successful register while specifying an invalid servicelevel, an exit code of 255 is returned. While I believe this exit code is too harsh for this registration case, it does match the exit code of 255 from subscribe --auto --servicelevel foo which is reasonable. For now I am satisfied with this consistent behavior. Moving to VERIFIED Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2012-0804.html |