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)