Bug 1250080
| Summary: | [RFE] make ANSI color coding of output optional | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Ales Zelinka <azelinka> |
| Component: | beakerlib | Assignee: | Dalibor Pospíšil <dapospis> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | low | ||
| Version: | rawhide | CC: | azelinka, bpeck, dapospis, dkutalek, mjia, mkyral, ohudlick, optak |
| Target Milestone: | --- | Keywords: | FutureFeature |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Enhancement | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-05-07 11:49:39 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: | 483014 | ||
| Bug Blocks: | |||
|
Description
Ales Zelinka
2015-08-04 13:27:22 UTC
I think the coloured output here is actually coming from beakerlib, right? Beakerlib thinks it's writing to a terminal because restraint runs tests attached to a pty, even though it's really just saving the output to a log file. Maybe we could set a env variable that beakerlib could use to disable the ansi color when set.
#@staticmethod
def printLog(message, prefix="LOG"):
color = uncolor = ""
if sys.stdout.isatty() and prefix in ("PASS", "FAIL", "INFO", "WARNING"):
color = termColors[prefix]
uncolor = "\033[0m"
would need to be updated..
(In reply to Dan Callaghan from comment #2) > I think the coloured output here is actually coming from beakerlib, right? right. reassigning again... @azelinka: Is this bug only restraint related ? (Do you think this feature is needed at beakerlib even if this will be resolved in restraint ?) this was filed against restraint by mistake, it's beakerlib bug that should be fixed in beakerlib. AFAIK. In my opinion the root of problem is in terminal checking, because there isn't check for env. variable TERM for compatible terminal (xterm* or vt100). coloring is now limitted to specific terminals |