From 497e40c76768b3e4fcbc9d0fa62084b498138424 Mon Sep 17 00:00:00 2001 From: Pavol Knapek Date: Wed, 13 Mar 2024 13:29:05 +0100 Subject: [PATCH] Truncate the tail of reason --- crhelper/resource_helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crhelper/resource_helper.py b/crhelper/resource_helper.py index 74ee7fe..60d0efc 100644 --- a/crhelper/resource_helper.py +++ b/crhelper/resource_helper.py @@ -224,9 +224,9 @@ def _get_func(self): def _send(self, status=None, reason="", send_response=_send_response): if len(str(str(self.Reason))) > 256: - self.Reason = "ERROR: (truncated) " + str(self.Reason)[len(str(self.Reason)) - 240:] + self.Reason = "ERROR: (truncated) " + str(self.Reason)[:240] if len(str(reason)) > 256: - reason = "ERROR: (truncated) " + str(reason)[len(str(reason)) - 240:] + reason = "ERROR: (truncated) " + str(reason)[:240] response_body = { 'Status': self.Status, 'PhysicalResourceId': str(self.PhysicalResourceId),