saltstack / saltstack/salt

[BUG]archive.extracted unzip command incorrcet order

Open
#57,461 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Execution-Module severity-low
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
archive.extracted options not being called in the correct order

Setup
(Please provide relevant configs and/or SLS files (be sure to remove sensitive info).

extract zip:
  archive.extracted:
    - name: /opt/zip/
    - source: /test.zip
    - use_cmd_unzip: True
    - options: -x "sys/*"
    - skip_verify: True

Steps to Reproduce the behavior
highstate the computer or state.apply it
It is running
[ERROR ] Command '['unzip', '-x', 'sys/*', '/test.zip', '-d', '/opt/zip/']' failed with return code: 9

Expected behavior
I am trying to ignore the folder call sys from extracting. Within unzip, the order of the command matters.
I expected it to run Command '['unzip', '/test.zip', '-x', 'sys/*', '-d', '/opt/zip/']'

I only tested on unzip, I am not sure if tar order matter for tar.
Screenshots
If applicable, add screenshots to help explain your problem.

Versions Report

Salt Version:
           Salt: 3000.3

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
         Jinja2: 2.11.1
        libgit2: Not Installed
       M2Crypto: 0.35.2
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.6.2
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 3.6.8 (default, Apr  2 2020, 13:34:55)
   python-gnupg: Not Installed
         PyYAML: 3.13
          PyZMQ: 15.3.0
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.1.4

System Versions:
           dist: centos 7.8.2003 Core
         locale: UTF-8
        machine: x86_64
        release: 3.10.0-1127.8.2.el7.x86_64
         system: Linux
        version: CentOS Linux 7.8.2003 Core

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the archive.extracted entry point and reproduce the supplied SLS on the reported unzip setup. Compare the generated command with the expected ordering, including the archive, options, and destination; the issue is resolved when the exclusion works without the return-code-9 failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.