mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
fix: file.directory state children_only kwarg did not work
This commit is contained in:
parent
86fab4e358
commit
e84c047329
1 changed files with 8 additions and 4 deletions
|
@ -721,6 +721,7 @@ def _check_directory(
|
|||
exclude_pat=None,
|
||||
max_depth=None,
|
||||
follow_symlinks=False,
|
||||
children_only=False,
|
||||
):
|
||||
"""
|
||||
Check what changes need to be made on a directory
|
||||
|
@ -792,10 +793,12 @@ def _check_directory(
|
|||
)
|
||||
if fchange:
|
||||
changes[path] = fchange
|
||||
# Recurse skips root (we always do dirs, not root), so always check root:
|
||||
fchange = _check_dir_meta(name, user, group, dir_mode, follow_symlinks)
|
||||
if fchange:
|
||||
changes[name] = fchange
|
||||
# Recurse skips root (we always do dirs, not root), so check root unless
|
||||
# children_only is specified:
|
||||
if not children_only:
|
||||
fchange = _check_dir_meta(name, user, group, dir_mode, follow_symlinks)
|
||||
if fchange:
|
||||
changes[name] = fchange
|
||||
if clean:
|
||||
keep = _gen_keep_files(name, require, walk_d)
|
||||
|
||||
|
@ -3954,6 +3957,7 @@ def directory(
|
|||
exclude_pat,
|
||||
max_depth,
|
||||
follow_symlinks,
|
||||
children_only,
|
||||
)
|
||||
|
||||
if tchanges:
|
||||
|
|
Loading…
Add table
Reference in a new issue