Skip to content

Commit ac23195

Browse files
committed
Revert "Avoid checksum generation when not desired"
This reverts commit 1c4a313.
1 parent c170b00 commit ac23195

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

pyartifactory/objects/artifact.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,14 @@ def deploy(
102102
if properties is not None:
103103
properties_param_str = ";".join(f"{k}={value}" for k, values in properties.items() for value in values)
104104
route = ";".join(s for s in [artifact_folder.as_posix(), properties_param_str] if s)
105-
headers: Dict[str, str] = {}
105+
artifact_check_sums = Checksums.generate(local_file)
106+
headers = {
107+
"X-Checksum-Sha1": artifact_check_sums.sha1,
108+
"X-Checksum-Sha256": artifact_check_sums.sha256,
109+
"X-Checksum": artifact_check_sums.md5,
110+
}
106111
if checksum_enabled:
107-
artifact_check_sums = Checksums.generate(local_file)
108-
headers.update(
109-
{
110-
"X-Checksum-Sha1": artifact_check_sums.sha1,
111-
"X-Checksum-Sha256": artifact_check_sums.sha256,
112-
"X-Checksum": artifact_check_sums.md5,
113-
"X-Checksum-Deploy": "true",
114-
},
115-
)
112+
headers["X-Checksum-Deploy"] = "true"
116113
try:
117114
self._put(
118115
route=route,

0 commit comments

Comments
 (0)