From 01a21dead6c0622691cbc2e8e7b9c926967a4984 Mon Sep 17 00:00:00 2001 From: Ian Cooke Date: Mon, 30 Oct 2023 15:39:54 -0400 Subject: [PATCH] fix sfn execution retrieval --- CHANGELOG.md | 5 ++++- src/cirrus/plugins/management/deployment.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74c272d..6bd5f01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - CLI `run-workflow` dropped an `s` from `json.loads`, and the help text on the timout argument was - incorrect. ([#5](https://github.com/cirrus-geo/cirrus-mgmt/pull/5) + incorrect. ([#5](https://github.com/cirrus-geo/cirrus-mgmt/pull/5)) +- Return correct execution(`[-1]`), as new Step Function executions are + appended to the `executions` list, from the StateDB + Item. ([#6](https://github.com/cirrus-geo/cirrus-mgmt/pull/6)) ## [v0.1.0] - 2023-08-01 diff --git a/src/cirrus/plugins/management/deployment.py b/src/cirrus/plugins/management/deployment.py index b92793d..789207f 100644 --- a/src/cirrus/plugins/management/deployment.py +++ b/src/cirrus/plugins/management/deployment.py @@ -302,7 +302,7 @@ def get_execution(self, arn): def get_execution_by_payload_id(self, payload_id): execs = self.get_payload_state(payload_id).get("executions", []) try: - exec_arn = execs[0] + exec_arn = execs[-1] except IndexError: raise exceptions.NoExecutionsError(payload_id)