self.logger.error("Backup FAILED at {} (see log file : {})".format(backup_end,status_log))
elifnotbackup_started:
self.logger.error("Can't find backup start date. Is there a problem with log ? (see log file : {})".format(status_log))
elifbackup_start<prev_cron:
self.logger.error("Backup didn't start at correct time: it started at {} but should have started after {}. (see log file : {})".format(backup_start,prev_cron,status_log))
elifnotbackup_ended:
self.logger.info("Backup currently running (started at {})".format(backup_start))
else:
self.logger.info("Backup OK, started at {} and lasted {} (see full stats at {}/private/{}/{} ).".format(
backup_start,
backup_end-backup_start,
self.getConfig("monitor_url"),
self.getConfig("statistic_basename"),
self.getConfig("statistic_name")
))
deftest(self):
"""
Test is never failing because we don't want to check when buildout deploy
the instance that the backup is working as it may not have started yet.
"""
returnTestResult(problem=False,message="")
defanomaly(self):
"""
Anomaly returns a TestResult instead of AnomalyResult because we don't
want to call bang when there is a problem. Usually the problem won't be
in the deployment of this instance but rather in the instance we are