diff options
author | Milo Casagrande <milo.casagrande@linaro.org> | 2015-03-26 13:25:29 +0100 |
---|---|---|
committer | Milo Casagrande <milo.casagrande@linaro.org> | 2015-03-26 13:25:29 +0100 |
commit | 412ad4b17e9edba98faff1b9c872282a06d6235f (patch) | |
tree | 89788f9594aba0f714addf4f289fbcd489f6be41 | |
parent | 08b3edfbece390d82d69a65b221f6f6456d7f35f (diff) |
Force sort on defconfigs and boards in emails.
-rw-r--r-- | app/utils/report/boot.py | 14 | ||||
-rw-r--r-- | app/utils/report/build.py | 7 |
2 files changed, 17 insertions, 4 deletions
diff --git a/app/utils/report/boot.py b/app/utils/report/boot.py index e47a97f..db425f1 100644 --- a/app/utils/report/boot.py +++ b/app/utils/report/boot.py @@ -731,13 +731,21 @@ def _parse_and_write_results(m_string, **kwargs): m_string.write(u"\n") m_string.write(G_(u"%s:\n") % arch) - for defconfig in d_get(arch).viewkeys(): + # Force defconfs to be sorted. + defconfs = list(d_get(arch).viewkeys()) + defconfs.sort() + + for defconfig in defconfs: m_string.write(u"\n") m_string.write(G_(u" %s:\n") % defconfig) def_get = d_get(arch)[defconfig].get + # Force boards to be sorted. + boards = list(d_get(arch)[defconfig].viewkeys()) + boards.sort() + if is_conflict: - for board in d_get(arch)[defconfig].viewkeys(): + for board in boards: m_string.write(G_(u" %s:\n") % board) for lab in def_get(board).viewkeys(): @@ -747,7 +755,7 @@ def _parse_and_write_results(m_string, **kwargs): 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(): + for board in boards: lab_count = 0 for lab in def_get(board).viewkeys(): lab_count += 1 diff --git a/app/utils/report/build.py b/app/utils/report/build.py index b04e6af..38c0f6f 100644 --- a/app/utils/report/build.py +++ b/app/utils/report/build.py @@ -225,6 +225,7 @@ def _parse_build_data(results): # pylint: disable=too-many-statements +# pylint: disable=too-many-branches def _create_build_email(**kwargs): """Parse the results and create the email text body to send. @@ -353,7 +354,11 @@ def _create_build_email(**kwargs): m_string.write(G_(u"%s:") % arch) m_string.write(u"\n\n") - for defconfig in err_get(arch).viewkeys(): + # Force defconfigs to be sorted. + defconfigs = list(err_get(arch).viewkeys()) + defconfigs.sort() + + for defconfig in defconfigs: err_numb = err_get(arch)[defconfig].get( models.ERRORS_KEY, 0) warn_numb = err_get(arch)[defconfig].get( |