salt icon indicating copy to clipboard operation
salt copied to clipboard

archive.extracted not working when using source_hash_update and if_missing

Open meng-fu opened this issue 10 years ago • 2 comments

Description of Issue/Question

I am trying to use the source_hash_update and if_missing parameters as an OR condition to determine if an archive should be extracted. ie. If the source hash has changed OR the target directory is missing then the state should execute and extract the archive again.

Setup

Master: Salt Version: Salt: 2016.3.3

Dependency Versions: cffi: Not Installed cherrypy: Not Installed dateutil: 1.4.1 gitdb: Not Installed gitpython: Not Installed ioflo: Not Installed Jinja2: 2.7.3 libgit2: Not Installed libnacl: Not Installed M2Crypto: 0.20.2 Mako: Not Installed msgpack-pure: Not Installed msgpack-python: 0.4.6 mysql-python: Not Installed pycparser: Not Installed pycrypto: 2.6.1 pygit2: Not Installed Python: 2.6.6 (r266:84292, May 22 2015, 08:34:51) python-gnupg: Not Installed PyYAML: 3.11 PyZMQ: 14.5.0 RAET: Not Installed smmap: Not Installed timelib: Not Installed Tornado: 4.2.1 ZMQ: 4.0.5

System Versions: dist: redhat 6.7 Santiago machine: x86_64 release: 2.6.32-573.22.1.el6.x86_64 system: Linux version: Red Hat Enterprise Linux Server 6.7 Santiago

Minion: Salt Version: Salt: 2016.3.3

Dependency Versions: cffi: Not Installed cherrypy: Not Installed dateutil: Not Installed gitdb: Not Installed gitpython: Not Installed ioflo: Not Installed Jinja2: 2.7.2 libgit2: Not Installed libnacl: Not Installed M2Crypto: 0.21.1 Mako: Not Installed msgpack-pure: Not Installed msgpack-python: 0.4.8 mysql-python: Not Installed pycparser: Not Installed pycrypto: 2.6.1 pygit2: Not Installed Python: 2.7.5 (default, Nov 20 2015, 02:00:19) python-gnupg: Not Installed PyYAML: 3.11 PyZMQ: 15.3.0 RAET: Not Installed smmap: Not Installed timelib: Not Installed Tornado: 4.2.1 ZMQ: 4.1.4

System Versions: dist: centos 7.2.1511 Core machine: x86_64 release: 3.10.0-327.13.1.el7.x86_64 system: Linux version: CentOS Linux 7.2.1511 Core

SLS: some_artifact: archive.extracted: - name: /app - source: http://some_source.tar - source_hash: md5=some_hash - user: app - group: app - archive_format: tar - if_missing: /app/some_artifact

Result: Archive is not extracted when using both source_hash_update and if_missing, and the source hash hasn't changed but the if_missing directory IS missing.


      ID: some_artifact
Function: archive.extracted
    Name: /app
  Result: True
 Comment: Hash 45b3a778195b3de666c93773c59c0e92 has not changed
 Started: 06:41:07.659941
Duration: 0.693 ms
 Changes:   

Archive is extracted when the source_hash_update parameter is removed.

meng-fu avatar Nov 04 '16 13:11 meng-fu

Thanks for reporting this. I have tagged it with our platform team to take a look.

If you could take a look, we love pull requests. My guess is that if source_hash_update is set to True, archive.extracted just returns and doesn't check any of the other information about the state

Thanks Daniel

gtmanfred avatar Nov 04 '16 14:11 gtmanfred

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

stale[bot] avatar Jul 20 '18 17:07 stale[bot]