]> code.ossystems Code Review - openembedded-core.git/commitdiff
utils/logparser.py: fix section check
authorRobert Yang <liezhi.yang@windriver.com>
Tue, 22 Aug 2017 01:23:09 +0000 (18:23 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 23 Aug 2017 13:12:39 +0000 (14:12 +0100)
The section might be None or '', so use "if section" for it.

Fixed:
File "/buildarea/lyang1/poky/meta/lib/oeqa/utils/logparser.py", line 113, in log_as_files
    prefix += section
TypeError: Can't convert 'NoneType' object to str implicitly

[YOCTO #11547]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/utils/logparser.py

index 4355ce0b767cbd7bccc98e5455bda2bc0f4afb4c..0670627c3c07a973615f371d909126ac5a301464 100644 (file)
@@ -109,7 +109,7 @@ class Result(object):
             prefix = ''
             for x in test_status:
                 prefix +=x+'.'
-            if (section != ''):
+            if section:
                 prefix += section
             section_file = os.path.join(target_dir, prefix)
             # purge the file contents if it exists