Bug 1030604
Summary: | subscription-manager repo-override should unwrap error list and print it to stderr | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | John Sefler <jsefler> |
Component: | subscription-manager | Assignee: | Michael Stead <mstead> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | John Sefler <jsefler> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.0 | CC: | ckozak, fsharath, mstead |
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: | 2014-06-13 10:25:23 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: | 863175 |
Description
John Sefler
2013-11-14 19:10:38 UTC
This will be a two part fix -- one for subscription-manager and one for candlepin. On candlepin, a BadRequestException was being created and thrown with a List.toString() as the message which produced the "[..., ...]" message string. Also, the messages in that list were being duplicated as seen above which isn't very useful. The Fix: Invalid overrides are collected in a set and a single message will be returned in the following format: "Not allowed to override values for: NAME1, NAME2, ..." Changes were required in subscription-manager to changed the error code and to print to stderr. As requested by jsefler (irc), it will now return a code of 1 instead of 255, and will write to stderr. Component version and pull request numbers to follow once reviewed and committed. candlepin pull request (currently merged and in master branch): https://github.com/candlepin/candlepin/pull/439 subscription-manager pull request (waiting on review and merge): https://github.com/candlepin/subscription-manager/pull/836 Error code and stderr printing available in: subscription-manager-1.10.8-1 Proper message formatting available in: candlepin-0.8.34-1+ Testing Version... [root@jsefler-7 ~]# subscription-manager version server type: Red Hat Subscription Management subscription management server: 0.8.33-1 subscription-manager: 1.10.8-1.el7 python-rhsm: 1.10.8-1.el7 [root@jsefler-7 ~]# subscription-manager repo-override --repo=repo1 --repo=repo2 --repo=repo3 --add=baseurl:https://cdn.redhat.com/foo-testing --add=name:repoName --add=enabled:1 --add=label:repoLabel 1>/tmp/stdout 2>/tmp/stderr [root@jsefler-7 ~]# echo $? 1 [root@jsefler-7 ~]# cat /tmp/stderr Not allowed to override values for: name, label, baseurl [root@jsefler-7 ~]# cat /tmp/stdout [root@jsefler-7 ~]# VERIFIED: The feedback message is now nicely unwrapped and rendered uniquely. For the sake of consistency with exitCode/stdout/stderr behavior from other subscription-manager commands, I would suggest that we keep the exitCode of 1 (which indicates the call was not completely successful (usually exitCode=0), but we were also not crashing and burning (usually exitCode=255)). However, let's move the feedback message to stdout since stderr is usually accompanied by exitCode 255. FAILEDQA: Move the message from stderr to stdout. Awaiting PR Review: https://github.com/candlepin/subscription-manager/pull/844 Print error to stdout, and exit with code 1. Available: subscription-manager-1.10.9-1+ Version # subscription-manager version server type: Red Hat Subscription Management subscription management server: 0.9.2-1 subscription-manager: 1.10.11-1.git.2.e96f6cd.el7 python-rhsm: 1.10.11-1.git.0.17362f9.el7 Verification # subscription-manager repo-override --repo=repo1 --repo=repo2 --repo=repo3 --add=baseurl:https://cdn.redhat.com/foo-testing --add=name:repoName --add=enabled:1 --add=label:repoLabel > /tmp/stdout 2> /tmp/stderr # echo $? 1 # cat /tmp/stdout Not allowed to override values for: name, label, baseurl # cat /tmp/stderr # Message displayed in stdout Exit code is 1 VERIFIED This request was resolved in Red Hat Enterprise Linux 7.0. Contact your manager or support representative in case you have further questions about the request. |