mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #31225 from pprince/PR/bugfix/file_tree
Fix in file_tree pillar (Fixes #31223.)
This commit is contained in:
commit
c58f654bc3
1 changed files with 4 additions and 3 deletions
|
@ -205,11 +205,12 @@ def _construct_pillar(top_dir, follow_dir_links, keep_newline=False):
|
|||
# Find current path in pillar tree
|
||||
pillar_node = pillar
|
||||
norm_dir_path = os.path.normpath(dir_path)
|
||||
prefix = os.path.relpath(norm_dir_path, norm_top_dir)
|
||||
if norm_dir_path != norm_top_dir:
|
||||
prefix = rel_path = os.path.relpath(norm_dir_path, norm_top_dir)
|
||||
path_parts = []
|
||||
while rel_path:
|
||||
rel_path, tail = os.path.split(rel_path)
|
||||
head = prefix
|
||||
while head:
|
||||
head, tail = os.path.split(head)
|
||||
path_parts.insert(0, tail)
|
||||
while path_parts:
|
||||
pillar_node = pillar_node[path_parts.pop(0)]
|
||||
|
|
Loading…
Add table
Reference in a new issue