Repository navigation
Add archive compressed capability - #68571
Open
ironman627 wants to merge 3 commits into
Open
ironman627 wants to merge 3 commits into
ironman627 wants to merge 3 commits into
Conversation
Contributor
|
rebase once the nightly master branch is green |
twangboy
previously approved these changes
Apr 22, 2026
- Rename changelog/archive-compressed.added.md to changelog/68571.added.md (towncrier requires numeric PR/issue ID in filename) - Remove unused CommandNotFoundError import from test file - Add pylint: disable=broad-except to catch-all exception handlers - Fix trailing whitespace and black formatting issues - Add blank line before compressed() function definition
twangboy
requested changes
Jul 13, 2026
| # Standard signature: archive.zip(zip_file, *sources, template=None, cwd=None, runas=None) | ||
| result = __salt__["archive.zip"]( | ||
| name, | ||
| *sources, |
Contributor
There was a problem hiding this comment.
This is a mismatch here. Look at how archive.zip (aliased from zip_) is actually defined:
def zip_(zip_file, sources, template=None, cwd=None, runas=None, zip64=False):The Issue: It does not accept *args for sources. It expects exactly two main positional arguments: zip_file and sources (which can be a comma-separated string or a Python list).
Should probably be:
result = __salt__["archive.zip"](name, sources)Regarding compression: The execution module hardcodes zipfile.ZIP_DEFLATED internally and doesn't expose a compression level parameter. You should document in the state that the compression argument is tar-only.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds compressed function to archive state module
What issues does this PR fix or reference?
N/A
New Behavior
Ability to compress files and directories
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
No