saltstack/salt — pull request #5479 by cfra (2013-06-11 01:21:17+00:00)
Title: Improve file.directory for clean=True

This change improves the behaviour of something like this:

```yaml
/etc/dhcp:
file.directory:
- clean: yes
- exclude_pat: 'dhclient*'
```

Originally, when running highstate with test=True, exclude_pat would be ignored and the comment would say that all files were to be deleted. With that change, exclude_pat is correctly taken into account.

I also added some tests to verify the behavior of file.directory with the clean option.