From e3ac581fdf3fdb8de4d0f7572d391c8e2abd4745 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Tue, 3 Feb 2026 08:25:10 -0500 Subject: [PATCH] Always use a tz aware timestamp * https://sonarcloud.io/project/issues?open=AZDmRade2PiUXMD3dXnx&id=ansible_awx --- awx/main/utils/formatters.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/awx/main/utils/formatters.py b/awx/main/utils/formatters.py index 5cf5e17a29..45ff3f0d95 100644 --- a/awx/main/utils/formatters.py +++ b/awx/main/utils/formatters.py @@ -257,8 +257,7 @@ class LogstashFormatter(LogstashFormatterBase): return fields def format(self, record): - stamp = datetime.utcfromtimestamp(record.created) - stamp = stamp.replace(tzinfo=tzutc()) + stamp = datetime.fromtimestamp(record.created, tz=tzutc()) message = { # Field not included, but exist in related logs # 'path': record.pathname