From cb6f53fc2bac2f215a6fbd0d43db08ad8d65a76d Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 30 Aug 2018 14:18:44 +0000 Subject: [PATCH] Fix --force mechanism --- src/yunohost/diagnosis.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/yunohost/diagnosis.py b/src/yunohost/diagnosis.py index 8fc46967b..93c2dfc67 100644 --- a/src/yunohost/diagnosis.py +++ b/src/yunohost/diagnosis.py @@ -88,7 +88,8 @@ class Diagnoser(): self.logger_debug, self.logger_warning, self.logger_info = loggers self.env = env - self.args = self.validate_args(args) + self.args = args + self.args.update(self.validate_args(args)) @property def cache_file(self): @@ -110,10 +111,12 @@ class Diagnoser(): def report(self): - if self.args.get("force", False) or self.cached_time_ago() < self.cache_duration: + if not self.args.get("force", False) and self.cached_time_ago() < self.cache_duration: self.logger_debug("Using cached report from %s" % self.cache_file) return self.get_cached_report() + self.logger_debug("Running diagnostic for %s" % self.id_) + new_report = { "id": self.id_, "cached_for": self.cache_duration, "reports": list(self.run())