Skip to content

Commit

Permalink
Merge pull request #58 from nbuchwitz/devel/utc-legacy-python
Browse files Browse the repository at this point in the history
fix(backup): Make UTC timezone work with legacy Python
  • Loading branch information
nbuchwitz authored Jun 21, 2024
2 parents 83cb8b9 + 155b377 commit e65532d
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 e65532d

Please sign in to comment.