From f168dcd19c78639c1a3ff94bc67fb58b6bb74842 Mon Sep 17 00:00:00 2001 From: Sajith Sasidharan Date: Fri, 12 Jun 2020 17:30:39 -0400 Subject: [PATCH] Use SlotsSequenceElement to render pre-repair problems --- src/allmydata/web/check_results.py | 13 +++++-------- .../web/deep-check-and-repair-results.xhtml | 4 ++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/allmydata/web/check_results.py b/src/allmydata/web/check_results.py index 5cd2bdbdc..ad02385f1 100644 --- a/src/allmydata/web/check_results.py +++ b/src/allmydata/web/check_results.py @@ -754,23 +754,20 @@ class DeepCheckAndRepairResultsRendererElement(Element, ResultsBase, ReloadMixin return tag return "" - # TODO: use SlotsSequenceElement @renderer def pre_repair_problems(self, req, tag): all_objects = self.monitor.get_status().get_all_results() + problems = [] + for path in sorted(all_objects.keys()): r = all_objects[path] assert ICheckAndRepairResults.providedBy(r) cr = r.get_pre_repair_results() if not cr.is_healthy(): - yield path, cr + problem = self._join_pathstring(path), ": ", self._html(cr.get_summary()) + problems.append(problem) - @renderer - def problem(self, req, tag): - # TODO: figure this out - # path, cr = data - return tag(self._join_pathstring(path), ": ", - self._html(cr.get_summary())) + return SlotsSequenceElement(tag, problems) @renderer def post_repair_problems_p(self, req, tag): diff --git a/src/allmydata/web/deep-check-and-repair-results.xhtml b/src/allmydata/web/deep-check-and-repair-results.xhtml index 9d16e27b9..50131ac60 100644 --- a/src/allmydata/web/deep-check-and-repair-results.xhtml +++ b/src/allmydata/web/deep-check-and-repair-results.xhtml @@ -35,8 +35,8 @@

Files/Directories That Had Problems: