def _check_results(crr): self.failUnless(ICheckAndRepairResults.providedBy(crr)) # we should detect the unhealthy, but skip over mutable-readcap # repairs until #625 is fixed self.failIf(crr.get_pre_repair_results().is_healthy()) self.failIf(crr.get_repair_attempted()) self.failIf(crr.get_post_repair_results().is_healthy())
def _check_results(crr): self.failUnless(ICheckAndRepairResults.providedBy(crr)) # we should detect the unhealthy, but skip over mutable-readcap # repairs until #625 is fixed self.failIf(crr.get_pre_repair_results().is_healthy()) self.failIf(crr.get_repair_attempted()) self.failIf(crr.get_post_repair_results().is_healthy())
def data_post_repair_problems(self, ctx, data): all_objects = self.monitor.get_status().get_all_results() for path in sorted(all_objects.keys()): r = all_objects[path] assert ICheckAndRepairResults.providedBy(r) cr = r.get_post_repair_results() if not cr.is_healthy(): yield path, cr
def data_post_repair_problems(self, ctx, data): all_objects = self.monitor.get_status().get_all_results() for path in sorted(all_objects.keys()): r = all_objects[path] assert ICheckAndRepairResults.providedBy(r) cr = r.get_post_repair_results() if not cr.is_healthy(): yield path, cr
def add_check_and_repair(self, r, path): if not r: return # non-distributed object, i.e. LIT file r = ICheckAndRepairResults(r) assert isinstance(path, (list, tuple)) pre_repair = r.get_pre_repair_results() post_repair = r.get_post_repair_results() self.objects_checked += 1 if pre_repair.is_healthy(): self.objects_healthy += 1 else: self.objects_unhealthy += 1 if not pre_repair.is_recoverable(): self.objects_unrecoverable += 1 self.corrupt_shares.extend(pre_repair.get_corrupt_shares()) if r.get_repair_attempted(): self.repairs_attempted += 1 if r.get_repair_successful(): self.repairs_successful += 1 else: self.repairs_unsuccessful += 1 if post_repair.is_healthy(): self.objects_healthy_post_repair += 1 else: self.objects_unhealthy_post_repair += 1 if not post_repair.is_recoverable(): self.objects_unrecoverable_post_repair += 1 self.all_results[tuple(path)] = r self.all_results_by_storage_index[r.get_storage_index()] = r self.corrupt_shares_post_repair.extend( post_repair.get_corrupt_shares())
def _check_results(crr): self.assertThat(ICheckAndRepairResults.providedBy(crr), Equals(True)) # we should detect the unhealthy, but skip over mutable-readcap # repairs until #625 is fixed self.assertThat(crr.get_pre_repair_results().is_healthy(), Equals(False)) self.assertThat(crr.get_repair_attempted(), Equals(False)) self.assertThat(crr.get_post_repair_results().is_healthy(), Equals(False))
def __init__(self, client, results): """ :param allmydata.interfaces.IStatsProducer client: stats provider. :param allmydata.interfaces.ICheckResults results: check/verify results. """ super(CheckAndRepairResultsRenderer, self).__init__() self._client = client self._results = None if results: self._results = ICheckAndRepairResults(results)
def add_check_and_repair(self, r, path): if not r: return # non-distributed object, i.e. LIT file r = ICheckAndRepairResults(r) assert isinstance(path, (list, tuple)) pre_repair = r.get_pre_repair_results() post_repair = r.get_post_repair_results() self.objects_checked += 1 if pre_repair.is_healthy(): self.objects_healthy += 1 else: self.objects_unhealthy += 1 if not pre_repair.is_recoverable(): self.objects_unrecoverable += 1 self.corrupt_shares.extend(pre_repair.get_data()["list-corrupt-shares"]) if r.get_repair_attempted(): self.repairs_attempted += 1 if r.get_repair_successful(): self.repairs_successful += 1 else: self.repairs_unsuccessful += 1 if post_repair.is_healthy(): self.objects_healthy_post_repair += 1 else: self.objects_unhealthy_post_repair += 1 if not post_repair.is_recoverable(): self.objects_unrecoverable_post_repair += 1 self.all_results[tuple(path)] = r self.all_results_by_storage_index[r.get_storage_index()] = r self.corrupt_shares_post_repair.extend(post_repair.get_data()["list-corrupt-shares"])
def post_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_post_repair_results() if not cr.is_healthy(): problem = self._join_pathstring(path), ": ", self._html( cr.get_summary()) problems.append({"problem": problem}) return SlotsSequenceElement(tag, problems)
def __init__(self, client, results): self.client = client self.r = None if results: self.r = ICheckAndRepairResults(results) rend.Page.__init__(self, results)