We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5550bba commit 049ca11Copy full SHA for 049ca11
1 file changed
src/gardenlinux/s3/s3_artifacts.py
@@ -196,18 +196,18 @@ def upload_from_directory(
196
if not artifact.match(f"{cname}*"):
197
continue
198
199
+ if not artifact.name.startswith(cname):
200
+ raise RuntimeError(
201
+ f"Artifact name '{artifact.name}' does not start with cname '{cname}'"
202
+ )
203
+
204
s3_key = f"objects/{cname}/{artifact.name}"
205
206
with artifact.open("rb") as fp:
207
md5sum = file_digest(fp, "md5").hexdigest()
208
sha256sum = file_digest(fp, "sha256").hexdigest()
209
- if artifact.name.startswith(cname):
- suffix = artifact.name[len(cname) :]
- else:
- raise RuntimeError(
- f"Artifact name '{artifact.name}' does not start with cname '{cname}'"
210
- )
+ suffix = artifact.name[len(cname) :]
211
212
artifact_metadata = {
213
"name": artifact.name,
0 commit comments