[BUG] file.recurse does not honour backup for deleted files
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description
When using "clean: True" on file.recurse, deleted files are not backed up.
The _clean_dir function in states/file.py does not consider the backup parameter at all.
Steps to Reproduce the behavior
- Create a state which calls file.recurse with
clean: Trueandbackup: minion - Manually add some extra files in the target directory
- Run the state and see the extra files removed
- Check the minion cache's backup file location and see that the files were never backed up.
Expected behavior
The extra files should be in the minions cache dir as backups.
Version
Name : salt
Version : 3003.2
Release : 1.el7
Architecture: noarch
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 in states/file.py at the _clean_dir function and trace how file.recurse handles clean: True and backup: minion. Reproduce the issue with extra files in the target directory, then verify that removed files appear in the minion cache's backup location as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100