Skip to content

Commit 2f38458

Browse files
author
Malte Münch
committed
Account for new tar format
Now, that we want to download the artifacts no longer from S3 one level of folder nesting is missing, this commit includes the required changes. Also the assertion for the .tar.xz suffix is removed. Signed-off-by: Malte Münch <[email protected]>
1 parent 9894102 commit 2f38458

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "python_gardenlinux_lib"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
description = "Contains tools to work with the features directory of gardenlinux, for example deducting dependencies from feature sets or validating cnames"
55
authors = ["Garden Linux Maintainers <[email protected]>"]
66
license = "Apache-2.0"

src/python_gardenlinux_lib/oras/registry.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,6 @@ def create_layer(
637637
return layer
638638

639639
def push_from_tar(self, architecture: str, version: str, cname: str, tar: str):
640-
assert tar.endswith(".tar.xz")
641640
tmpdir = tempfile.mkdtemp()
642641
extract_tar(tar, tmpdir)
643642

@@ -679,14 +678,10 @@ def extract_tar(tar: str, tmpdir: str):
679678
:param tar: str the full path to the tarball
680679
:param tmpdir: str the tmp directory to extract to
681680
"""
682-
fullname = os.path.basename(tar).removesuffix(".tar.xz")
683681
try:
684682
tar_obj = tarfile.open(tar)
685683
tar_obj.extractall(filter="data", path=tmpdir)
686684
tar_obj.close()
687-
for file in os.listdir(f"{tmpdir}/{fullname}"):
688-
shutil.move(f"{tmpdir}/{fullname}/{file}", tmpdir)
689-
shutil.rmtree(f"{tmpdir}/{fullname}", ignore_errors=True)
690685
for file in os.listdir(tmpdir):
691686
if file.endswith(".pxe.tar.gz"):
692687
logger.info(f"Found nested artifact {file}")

0 commit comments

Comments
 (0)