Skip to content
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.directory fails to check directory permissions correctly #52173

Closed
amendlik opened this issue Mar 14, 2019 · 4 comments
Closed

file.directory fails to check directory permissions correctly #52173

amendlik opened this issue Mar 14, 2019 · 4 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior P2 Priority 2 severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@amendlik
Copy link
Contributor

Description of Issue/Question

Running the file.directory state with test=true always reports changes to be made, even when the directories are in the desired state.

Setup

salt-log-permissions:
  file.directory:
    - name: /var/log/salt
    - recurse:
      - mode
    - dir_mode: '2770'
    - file_mode: '0660'
# salt-call state.apply salt.logs test=false
local:
----------
          ID: salt-log-permissions
    Function: file.directory
        Name: /var/log/salt
      Result: True
     Comment: Directory /var/log/salt is in the correct state
     Started: 01:49:00.152027
    Duration: 59.972 ms
     Changes:   

Summary for local
------------
Succeeded: 1
Failed:    0
------------
Total states run:     1
Total run time:  59.972 ms

# salt-call state.apply salt.logs test=true
local:
----------
          ID: salt-log-permissions
    Function: file.directory
        Name: /var/log/salt
      Result: None
     Comment: The following files will be changed:
              /var/log/salt/api: mode - 0660
              /var/log/salt/master: mode - 0660
              /var/log/salt/key: mode - 0660
              /var/log/salt/minion: mode - 0660
              /var/log/salt: mode - 0660
     Started: 01:49:13.021802
    Duration: 33.664 ms
     Changes:   

Summary for local
------------
Succeeded: 1 (unchanged=1)
Failed:    0
------------
Total states run:     1
Total run time:  33.664 ms

Versions Report

Salt Version:
           Salt: 2019.2.0
 
Dependency Versions:
           cffi: 1.11.5
       cherrypy: unknown
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: 0.27.8
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.6.1
   mysql-python: Not Installed
      pycparser: 2.18
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: 0.27.4
         Python: 3.6.8 (default, Feb  8 2019, 21:14:59)
   python-gnupg: Not Installed
         PyYAML: 3.13
          PyZMQ: 18.0.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.3.1
 
System Versions:
           dist:   
         locale: UTF-8
        machine: amd64
        release: 11.2-STABLE
         system: FreeBSD
        version: Not Installed
@amendlik
Copy link
Contributor Author

There are two problems contributing to this issue. One is addressed in PR #52175. Issue #52174 still needs to be fixed for Python 3 installations.

@Ch3LL
Copy link
Contributor

Ch3LL commented Mar 14, 2019

are you okay closing this once your PR is merged and handling the other issue in #52174 there?

also thanks for the PR!

@Ch3LL Ch3LL added Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around P2 Priority 2 team-core labels Mar 14, 2019
@Ch3LL Ch3LL added this to the Approved milestone Mar 14, 2019
@amendlik
Copy link
Contributor Author

I would like the core team to propose a solution to #52174.

@amendlik
Copy link
Contributor Author

I created PR #52211 to address issue #52174.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior P2 Priority 2 severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants