diff options
author | Milo Casagrande <milo.casagrande@linaro.org> | 2015-03-20 15:54:26 +0100 |
---|---|---|
committer | Milo Casagrande <milo.casagrande@linaro.org> | 2015-03-20 15:54:26 +0100 |
commit | 82c48d522fa7026202d4c1f417501b0ab2e3a5df (patch) | |
tree | 8c04d4898881125efde92994ad6d1e49f7816585 | |
parent | 1b0d3873948ee959e11f129c362639d9ec5758c9 (diff) |
Fix mail structure.
-rw-r--r-- | app/utils/report/boot.py | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/app/utils/report/boot.py b/app/utils/report/boot.py index 3fc32eb..13463c0 100644 --- a/app/utils/report/boot.py +++ b/app/utils/report/boot.py @@ -717,6 +717,9 @@ def _parse_and_write_results(m_string, **kwargs): :type data: dict :param m_string: The open file where to write. :type m_string: io.StringIO + :param is_conflict: If the data passed has to be considered a conflict + aggregation. + :type is_conflict: bool """ d_get = data.get @@ -731,19 +734,25 @@ def _parse_and_write_results(m_string, **kwargs): if is_conflict: for board in d_get(arch)[defconfig].viewkeys(): - lab_count = 0 - for lab in def_get(board).viewkeys(): - lab_count += 1 - m_string.write( - G_(u" %s: %d\n") % (board, lab_count)) - else: - for board in d_get(arch)[defconfig].viewkeys(): m_string.write(G_(u" %s:\n") % board) for lab in def_get(board).viewkeys(): m_string.write( G_(u" %s: %s\n") % (lab, def_get(board)[lab])) + else: + # Not a conflict data structure, we show only the count of + # the failed labs, not which one failed. + for board in d_get(arch)[defconfig].viewkeys(): + lab_count = 0 + for lab in def_get(board).viewkeys(): + lab_count += 1 + + lab_count_str = ( + P_("%d failed lab", "%d failed labs", lab_count) % + lab_count) + m_string.write( + G_(u" %s: %s\n") % (board, lab_count_str)) if failed_data: boot_failure_url = u"%(base_url)s/boot/?%(kernel)s&fail" % kwargs @@ -775,4 +784,4 @@ def _parse_and_write_results(m_string, **kwargs): conflict_count ) % {"conflict_comment": conflict_comment} ) - _traverse_data_struct(conflict_data, m_string) + _traverse_data_struct(conflict_data, m_string, is_conflict=True) |