Skip to content

Commit 2fb1246

Browse files
committed
Fix upload url
Signed-off-by: Sylvain Hellegouarch <[email protected]>
1 parent f9eedee commit 2fb1246

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
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.21.0...HEAD
66

7+
### Fixed
8+
9+
- fixed `chaosaws.s3.controls.upload` so the url is correctly added
10+
711
## [0.21.0][] - 2022-07-12
812
[0.21.0]: https://github.com/chaostoolkit-incubator/chaostoolkit-aws/compare/0.20.1...0.21.0
913

chaosaws/s3/controls/upload.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ def after_experiment_control(
5858
ext = "json"
5959
if as_yaml:
6060
ext = "yaml"
61-
state = yaml.safe_dump(state, indent=False, default_flow_style=False)
62-
else:
63-
state = json.dumps(state, indent=False)
6461

6562
suffix = ""
6663
if suffix_with_timestamp:
@@ -76,8 +73,13 @@ def after_experiment_control(
7673
extra_journal = extra.setdefault("journal", {})
7774
extra_journal["url"] = url
7875

76+
if as_yaml:
77+
journal = yaml.safe_dump(state, indent=False, default_flow_style=False)
78+
else:
79+
journal = json.dumps(state, indent=False)
80+
7981
with NamedTemporaryFile() as fd:
80-
fd.write(state.encode("utf-8"))
82+
fd.write(journal.encode("utf-8"))
8183
fd.seek(0)
8284
client.upload_file(fd.name, bucket_name, path)
8385

0 commit comments

Comments
 (0)