diff --git a/salt/states/file.py b/salt/states/file.py index 269e509fb0..e9f6c18f57 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -337,6 +337,7 @@ def _gen_keep_files(name, require): ret = set() if os.path.isdir(name): for root, dirs, files in os.walk(name): + ret.add(name) for name in files: ret.add(os.path.join(root, name)) for name in dirs: @@ -348,7 +349,7 @@ def _gen_keep_files(name, require): required_files = [comp for comp in require if 'file' in comp] for comp in required_files: for low in __lowstate__: - if low['__id__'] == comp['file']: + if low['name'] == comp['file']: fn = low['name'] if os.path.isdir(comp['file']): if _is_child(comp['file'], name):