From a0eb00b2cc186be6c8c462e13348013ef109c350 Mon Sep 17 00:00:00 2001 From: Sajith Sasidharan Date: Thu, 16 Apr 2020 17:26:21 -0400 Subject: [PATCH] Wrap renderer return values in tags --- src/allmydata/web/status.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/allmydata/web/status.py b/src/allmydata/web/status.py index e826173f2..e1ae15d9d 100644 --- a/src/allmydata/web/status.py +++ b/src/allmydata/web/status.py @@ -1224,39 +1224,39 @@ class StatisticsElement(Element): @renderer def load_average(self, req, tag): - return str(self._stats["stats"].get("load_monitor.avg_load")) + return tag(str(self._stats["stats"].get("load_monitor.avg_load"))) @renderer def peak_load(self, req, tag): - return str(self._stats["stats"].get("load_monitor.max_load")) + return tag(str(self._stats["stats"].get("load_monitor.max_load"))) @renderer def uploads(self, req, tag): files = self._stats["counters"].get("uploader.files_uploaded", 0) bytes = self._stats["counters"].get("uploader.bytes_uploaded", 0) - return ("%s files / %s bytes (%s)" % - (files, bytes, abbreviate_size(bytes))) + return tag(("%s files / %s bytes (%s)" % + (files, bytes, abbreviate_size(bytes)))) @renderer def downloads(self, req, tag): files = self._stats["counters"].get("downloader.files_downloaded", 0) bytes = self._stats["counters"].get("downloader.bytes_downloaded", 0) - return ("%s files / %s bytes (%s)" % - (files, bytes, abbreviate_size(bytes))) + return tag("%s files / %s bytes (%s)" % + (files, bytes, abbreviate_size(bytes))) @renderer def publishes(self, req, tag): files = self._stats["counters"].get("mutable.files_published", 0) bytes = self._stats["counters"].get("mutable.bytes_published", 0) - return "%s files / %s bytes (%s)" % (files, bytes, - abbreviate_size(bytes)) + return tag("%s files / %s bytes (%s)" % (files, bytes, + abbreviate_size(bytes))) @renderer def retrieves(self, req, tag): files = self._stats["counters"].get("mutable.files_retrieved", 0) bytes = self._stats["counters"].get("mutable.bytes_retrieved", 0) - return "%s files / %s bytes (%s)" % (files, bytes, - abbreviate_size(bytes)) + return tag("%s files / %s bytes (%s)" % (files, bytes, + abbreviate_size(bytes))) @renderer def raw(self, req, tag):