summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--awx/main/tasks/host_metrics.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/awx/main/tasks/host_metrics.py b/awx/main/tasks/host_metrics.py
index 750cd199c5..e5f1263ad1 100644
--- a/awx/main/tasks/host_metrics.py
+++ b/awx/main/tasks/host_metrics.py
@@ -221,7 +221,7 @@ class HostMetricSummaryMonthlyTask:
self.records_to_update.append(summary)
return summary
- def _find_summary(self, month):
+ def _find_summary(self, month: datetime.date):
"""
Existing summaries are ordered by month ASC.
This method is called with month in ascending order too => only 1 traversing is enough
@@ -229,6 +229,8 @@ class HostMetricSummaryMonthlyTask:
summary = None
while not summary and self.existing_summaries_idx < self.existing_summaries_cnt:
tmp = self.existing_summaries[self.existing_summaries_idx]
+ if isinstance(tmp, datetime.datetime):
+ tmp = tmp.date()
if tmp.date < month:
self.existing_summaries_idx += 1
elif tmp.date == month: