Bug 692819 - journal tracebacks on colorized output when WARN is printed
Summary: journal tracebacks on colorized output when WARN is printed
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: beakerlib
Version: rawhide
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Petr Muller
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 693997 694392 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-01 09:58 UTC by Karel Srot
Modified: 2016-09-20 02:07 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-25 13:54:32 UTC
Type: ---


Attachments (Terms of Use)

Description Karel Srot 2011-04-01 09:58:01 UTC
Description of problem:


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'ausearch -m AVC -ts 04/01/2011 05:43:51 > /tmp/tmp.bxhS77B2fB'
:: [   PASS   ] :: Running 'cat /tmp/tmp.bxhS77B2fB'
:: [   FAIL   ] :: number of lines in /tmp/tmp.bxhS77B2fB should be 0 (Assert: expected 0, got 4)
:: [   PASS   ] :: Running 'semodule -r testpolicy'
:: [   PASS   ] :: Running 'rm -f testpolicy.pp'
:: [   LOG    ] :: Duration: 41s
:: [   LOG    ] :: Assertions: 4 good, 1 bad
Traceback (most recent call last):
  File "/usr/bin/beakerlib-journalling", line 468, in <module>
    createLog(options.testid, options.severity)
  File "/usr/bin/beakerlib-journalling", line 181, in createLog
    printPhaseLog(nod,severity)
  File "/usr/bin/beakerlib-journalling", line 123, in printPhaseLog
    printLog("RESULT: %s" % phaseName, phaseResult)
  File "/usr/bin/beakerlib-journalling", line 70, in printLog
    color = termColors[prefix]
KeyError: u'WARN'
:: [05:44:42] ::  JOURNAL XML: /tmp/beakerlib-ogTVleP/journal.xml
:: [05:44:42] ::  JOURNAL TXT: /tmp/beakerlib-ogTVleP/journal.txt


Version-Release number of selected component (if applicable):
[root@ibm-z10-28 bz543941-running-vhostmd]# rpm -qa | grep beaker
beaker-distribution-install-1.10-12.noarch
beakerlib-redhat-1-4.el6.noarch
beaker-distribution-reservesys-2.0-48.noarch
beakerlib-1.3-6.el6.noarch


How reproducible:
manually executed a test /CoreOS/selinux-policy/Regression/bz543941-running-vhostmd on a reserved s390x RHEL6.0 machine

Comment 1 Petr Muller 2011-04-01 14:54:29 UTC
This is a nice python programming (and reviewing) bug :)

>>> "WARN" in "WARNING"
True

and so I pushed the following patch. Thanks for the report.

--- a/src/python/journalling.py
+++ b/src/python/journalling.py
@@ -66,7 +66,7 @@ def printPurpose(message):
 
 def printLog(message, prefix="LOG"):
   color = uncolor = ""
-  if sys.stdout.isatty() and prefix in "PASS FAIL INFO WARNING":
+  if sys.stdout.isatty() and prefix in ("PASS", "FAIL", "INFO", "WARNING"):
     color = termColors[prefix]
     uncolor = "\033[0m"
   for line in message.split("\n"):
--

Comment 2 Petr Muller 2011-04-06 10:57:40 UTC
*** Bug 693997 has been marked as a duplicate of this bug. ***

Comment 3 Petr Muller 2011-04-07 10:38:54 UTC
*** Bug 694392 has been marked as a duplicate of this bug. ***

Comment 4 Petr Muller 2011-04-07 10:40:08 UTC
We also probably want to add WARN coloring as well

Comment 6 Petr Muller 2012-07-25 13:54:32 UTC
Closing, this should be in for a long time.


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