New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file.managed source_hash case-sensitive for test=true #48230

Closed
whytewolf opened this Issue Jun 20, 2018 · 2 comments

Comments

@whytewolf
Contributor

whytewolf commented Jun 20, 2018

Description of Issue/Question

When using source_hash for a file if the source_hash is uppercase for any reason instead of lowercase the while using test=true the file will be detected as changing while with test=false it will not.

The desired result would be the reaction of test=true being the same as test=false. Detecting that the file isn't changed when the hash is uppercase.

Setup

test.txt

testing

test.sls

testing1:
  file.managed:
    - name: /tmp/testing
    - source: http://192.168.70.10/test.txt
    - source_hash: 12a61f4e173fb3a11c05d6471f74728f76231b4a5fcd9667cef3af87a3ae4dc2

testing2:
  file.managed:
    - name: /tmp/test
    - source: http://192.168.70.10/test.txt
    - source_hash: 12A61F4E173FB3A11C05D6471F74728F76231B4A5FCD9667CEF3AF87A3AE4DC2

Steps to Reproduce Issue

(Include debug logs if possible and relevant.)

[root@master salt]# salt '*' state.apply test test=true
master:
----------
          ID: testing1
    Function: file.managed
        Name: /tmp/testing
      Result: True
     Comment: The file /tmp/testing is in the correct state
     Started: 19:05:03.875405
    Duration: 14.491 ms
     Changes:
----------
          ID: testing2
    Function: file.managed
        Name: /tmp/test
      Result: None
     Comment: The file /tmp/test is set to be changed
     Started: 19:05:03.890063
    Duration: 7.758 ms
     Changes:
              ----------
              diff:

Summary for master
------------
Succeeded: 2 (unchanged=1, changed=1)
Failed:    0
------------
Total states run:     2
Total run time:  22.249 ms
[root@master salt]# salt '*' state.apply test test=false
master:
----------
          ID: testing1
    Function: file.managed
        Name: /tmp/testing
      Result: True
     Comment: File /tmp/testing is in the correct state
     Started: 19:05:10.787017
    Duration: 39.436 ms
     Changes:
----------
          ID: testing2
    Function: file.managed
        Name: /tmp/test
      Result: True
     Comment: File /tmp/test is in the correct state
     Started: 19:05:10.826846
    Duration: 21.62 ms
     Changes:

Summary for master
------------
Succeeded: 2
Failed:    0
------------
Total states run:     2
Total run time:  61.056 ms

Versions Report

[root@master salt]# salt-call --versions
Salt Version:
           Salt: 2018.3.0

Dependency Versions:
           cffi: 1.6.0
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: 0.6.4
      gitpython: 1.0.1
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: 0.26.3
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.1
   mysql-python: Not Installed
      pycparser: 2.14
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: 0.26.4
         Python: 2.7.5 (default, Aug  4 2017, 00:39:18)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: 0.9.0
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4

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

Also tested with 2018.3.1

@whytewolf whytewolf added the ZD label Jun 20, 2018

@whytewolf

This comment has been minimized.

Contributor

whytewolf commented Jun 20, 2018

ZD-2635

@garethgreenaway garethgreenaway added this to the Approved milestone Jun 21, 2018

@rallytime rallytime self-assigned this Jul 2, 2018

rallytime added a commit to rallytime/salt that referenced this issue Jul 3, 2018

Add regression test for Issue saltstack#48230
This also tests the fix for issue saltstack#38914
@rallytime

This comment has been minimized.

Contributor

rallytime commented Jul 3, 2018

This is fixed with #48422

@rallytime rallytime closed this in a6abf85 Jul 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment