From cc3df8790f8b6f9328b51fcf74a8fc776d7ff23c Mon Sep 17 00:00:00 2001 From: Sylvain <35365065+sanderegg@users.noreply.github.com> Date: Tue, 3 Sep 2024 21:34:06 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9BAutoscaling:=20SSM=20client=20key?= =?UTF-8?q?=20error=20fix=20(#6299)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/aws-library/src/aws_library/ssm/_client.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/aws-library/src/aws_library/ssm/_client.py b/packages/aws-library/src/aws_library/ssm/_client.py index 90e71fa1048..2b51a93b82a 100644 --- a/packages/aws-library/src/aws_library/ssm/_client.py +++ b/packages/aws-library/src/aws_library/ssm/_client.py @@ -118,8 +118,16 @@ async def get_command(self, instance_id: str, *, command_id: str) -> SSMCommand: instance_ids=[response["InstanceId"]], status=response["Status"] if response["Status"] != "Delayed" else "Pending", message=response["StatusDetails"], - start_time=arrow.get(response["ExecutionStartDateTime"]).datetime, - finish_time=arrow.get(response["ExecutionEndDateTime"]).datetime, + start_time=( + arrow.get(response["ExecutionStartDateTime"]).datetime + if response.get("ExecutionStartDateTime") + else None + ), + finish_time=( + arrow.get(response["ExecutionEndDateTime"]).datetime + if response.get("ExecutionEndDateTime") + else None + ), ) @log_decorator(_logger, logging.DEBUG)