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

Check file_mode in file.directory and _check_directory #50653

Merged
merged 3 commits into from Dec 12, 2018

Conversation

Projects
None yet
3 participants
@lexvella
Copy link
Contributor

commented Nov 27, 2018

What does this PR do?

It fixes a bug in salt.states.file.directory that caused the function to return prematurely without evaluating the mode of files in a directory to be recursively evaluated. This PR adds a check for the file_mode parameter in the _check_directory function used by salt.states.file.directory

What issues does this PR fix or reference?

file.directory recurse not always changing perms #49393

Previous Behavior

_check_directory does not evaluate the mode of files, only the user and group.

New Behavior

_check_directory evaluates the user, group, and mode of files.

Tests written?

No

Commits signed with GPG?

Yes

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

lexvella added some commits Nov 27, 2018

@cachedout cachedout requested a review from terminalmage Nov 28, 2018

@cachedout cachedout merged commit 264a042 into saltstack:2018.3 Dec 12, 2018

10 checks passed

WIP Ready for review
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint Python lint test has passed
Details
jenkins/pr/py2-centos-7 The py2-centos-7 job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py2-windows-2016 The py2-windows-2016 job has passed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details
jenkins/pr/py3-windows-2016 The py3-windows-2016 job has passed
Details

amendlik added a commit to amendlik/salt that referenced this pull request Mar 14, 2019

Fix states.file checking directory permissions recursively
A change was introduced in 79f6b42 (PR saltstack#50653) to check the file
mode recursively. This change introduced a variable shadow that
caused directory permission checking to fail.

amendlik added a commit to amendlik/salt that referenced this pull request Apr 23, 2019

Fix states.file checking directory permissions recursively
A change was introduced in 79f6b42 (PR saltstack#50653) to check the file
mode recursively. This change introduced a variable shadow that
caused directory permission checking to fail.

Akm0d added a commit to Akm0d/salt that referenced this pull request Jun 5, 2019

Fix states.file checking directory permissions recursively
A change was introduced in 79f6b42 (PR saltstack#50653) to check the file
mode recursively. This change introduced a variable shadow that
caused directory permission checking to fail.

Akm0d added a commit that referenced this pull request Jun 6, 2019

Check dir_mode recursively in file.directory (#53385)
* Created a test case

* Fix states.file checking directory permissions recursively

A change was introduced in 79f6b42 (PR #50653) to check the file
mode recursively. This change introduced a variable shadow that
caused directory permission checking to fail.

* Rename mode variable to dir_mode for clarity

* Revert "Created a test case"

This reverts commit 26fd01a.

* Re-added test case without irrelevant cosmetic code changes

* Send string instead of integer - normalize values before comparison
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.