fix offset aware datetimes
diff --git a/staffeln/conductor/manager.py b/staffeln/conductor/manager.py
index 5b05a62..a8d69a0 100755
--- a/staffeln/conductor/manager.py
+++ b/staffeln/conductor/manager.py
@@ -128,7 +128,7 @@
report_period_mins = CONF.conductor.report_period
threshold_strtime = datetime.now() - timedelta(minutes=report_period_mins)
filters = {
- "created_at__lt": threshold_strtime,
+ "created_at__lt": threshold_strtime.astimezone(),
"backup_status": constants.BACKUP_COMPLETED,
}
success_tasks = self.controller.get_queues(filters=filters)
@@ -210,7 +210,7 @@
if backup_age > retention_time:
# Backup remain longer than retention, need to purge it.
return True
- elif self.threshold_strtime < backup.created_at:
+ elif self.threshold_strtime.astimezone() < backup.created_at:
return True
return False