Skip to content

Commit

Permalink
fix(backup): Make UTC timezone work with legacy Python
Browse files Browse the repository at this point in the history
Fixes #57

Signed-off-by: Nicolai Buchwitz <[email protected]>
  • Loading branch information
nbuchwitz committed Jun 19, 2024
1 parent 83cb8b9 commit 155b377
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions check_pve.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

try:
import argparse
from datetime import datetime
from datetime import datetime, timezone
from enum import Enum

import requests
Expand Down Expand Up @@ -677,7 +677,7 @@ def check_vzdump_backup(self, name: Optional[str] = None) -> None:
# Filter by timestamp, if provided
delta = self.threshold_critical("delta")
if delta is not None:
now = datetime.now(datetime.UTC).timestamp()
now = datetime.now(timezone.utc).timestamp()

tasks = [t for t in tasks if not delta.check(now - t["starttime"])]

Expand Down

0 comments on commit 155b377

Please sign in to comment.