Fix backup size comparaison on backup failure

This commit is contained in:
Orsiris de Jong 2024-02-05 19:45:14 +01:00
parent eaf59fdd0e
commit b0964dd151

View file

@ -225,7 +225,8 @@ def restic_json_to_prometheus(
backup_too_small = False
if minimum_backup_size_error:
if restic_json["data_added"] < int(BytesConverter(str(minimum_backup_size_error).replace(" ", "")).bytes):
if not restic_json["data_added"] or \
restic_json["data_added"] < int(BytesConverter(str(minimum_backup_size_error).replace(" ", "")).bytes):
backup_too_small = True
good_backup = restic_result and not backup_too_small