Skip to content

Commit

Permalink
Revert "fix support for nested modules in archives"
Browse files Browse the repository at this point in the history
This reverts commit d9c2053.
  • Loading branch information
dgraeber committed Dec 3, 2024
1 parent a39fbf2 commit a2ebe88
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
10 changes: 0 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,13 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a Ch

### Changes

### Fixes


## v5.0.1 (2024-12-02)

### New

### Changes

- Adds `seedfarmer --version` to validate package without running explicit command
- Added ability to disable env replacement in module parameters
- Updating bootstrap docs with minimum permissions
- Update manifest example module versions
- Update session manager to pass toolchain role region to sts

### Fixes
- allow nested modules in archives pulled over HTTPS (ref issue/749)

## v5.0.0 (2024-08-16)

Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ markers = [
"mgmt_metadata_support: marks all `mgmt_metadata_support` tests",
"mgmt_build_info: marks all `mgmt_build_info` tests",
"mgmt_git_support: marks all `mgmt_git_support` tests",
"mgmt_git_release: marks all `mgmt_git_release` tests",
"mgmt_archive_support: marks all `mgmt_archive_support` tests",
"service: marks all `services` tests",
"projectpolicy: marks all `projectpolicy` tests",
Expand Down
10 changes: 9 additions & 1 deletion seedfarmer/mgmt/archive_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import os.path
import pathlib
import re
import shutil
import tarfile
from typing import Optional, Tuple
from urllib.parse import parse_qs, urlparse
Expand Down Expand Up @@ -89,10 +90,17 @@ def _process_archive(archive_name: str, response: Response, extracted_dir: str)
archive_file.write(response.content)

extracted_dir_path = os.path.join(parent_dir, extracted_dir)
_ = _extract_archive(archive_name, extracted_dir_path)
embedded_dir = _extract_archive(archive_name, extracted_dir_path)

os.remove(archive_name)

if embedded_dir:
file_names = os.listdir(os.path.join(extracted_dir_path, embedded_dir))
for file_name in file_names:
shutil.move(os.path.join(extracted_dir_path, embedded_dir, file_name), extracted_dir_path)

os.rmdir(os.path.join(extracted_dir_path, embedded_dir))

return extracted_dir_path


Expand Down

0 comments on commit a2ebe88

Please sign in to comment.