Skip to content

Commit 11ffa98

Browse files
committed
Set url into journal
Signed-off-by: Sylvain Hellegouarch <[email protected]>
1 parent 1a52852 commit 11ffa98

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
[Unreleased]: https://github.com/chaostoolkit-incubator/chaostoolkit-aws/compare/0.20.1...HEAD
66

7+
### Changed
8+
9+
- Setting the S3 URL into the journal when stored
10+
711
## [0.20.1][] - 2022-07-11
812
[0.20.1]: https://github.com/chaostoolkit-incubator/chaostoolkit-aws/compare/0.20.0...0.20.1
913

chaosaws/s3/controls/upload.py

+7
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ def after_experiment_control(
6969

7070
path = f"{dirpath}/journal{suffix}.{ext}"
7171

72+
# setting the absolute url of the uploaded journal into the journal itself
73+
region = configuration.get("aws_region")
74+
url = f"https://{bucket_name}.s3.{region}.amazonaws.com/{dirpath}/{path}"
75+
extra = state.setdefault("extra", {})
76+
extra_journal = extra.setdefault("journal", {})
77+
extra_journal["url"] = url
78+
7279
with NamedTemporaryFile() as fd:
7380
fd.write(state.encode("utf-8"))
7481
fd.seek(0)

0 commit comments

Comments
 (0)