salt.pillar.file_tree not following file symlinks - possible regression?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
If I put a symlink in the file_tree to another file also in the file tree the file is not included in the generated pilllar data for the node (the other regular files are included as expected) and the master log has an error logged:
2020-05-20 19:10:20,190 [salt.loaded.int.pillar.file_tree:233 ][ERROR ][22791] file_tree: /path/to/pillar/files/hosts/minionid/files/some/file: not a regular file
The example tree in the docs (https://docs.saltstack.com/en/latest/ref/pillar/all/salt.pillar.file_tree.html) includes a symlink but the example pillar rendering does not relate to that tree at all (I have opened a separate documentation issue for that - #57405) but I found a mirror of the documentation for Salt 2015.5.0 (https://ansible-cn.readthedocs.io/en/latest/ref/pillar/all/salt.pillar.file_tree.html) where the example clearly shows this should work (and, presuming it did work, that means this is a regression):
./hosts/test-host/files/another-testdir/symlink-to-file1.txt
...
test-host: ---------- files: ---------- another-testdir: ---------- symlink-to-file1.txt: Contents of file #1.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the salt.pillar.file_tree entry point and the error reported at line 233, then compare its behavior with the linked file_tree documentation examples. Done means a symlink to another file in the tree is included in generated pillar data without the “not a regular file” error, with regression coverage added where the project’s existing tests for this module belong.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100