Merge pull request #36245 from terminalmage/roots-bug

roots backend: Don't include '.' or '..' in empty_dirs
This commit is contained in:
Mike Place 2016-09-13 09:52:14 +09:00 committed by GitHub
commit dcc9380996

View File

@ -292,7 +292,8 @@ def _file_lists(load, form):
dir_rel_fn = dir_rel_fn.replace('\\', '/')
ret['dirs'].append(dir_rel_fn)
if len(dirs) == 0 and len(files) == 0:
if not salt.fileserver.is_file_ignored(__opts__, dir_rel_fn):
if dir_rel_fn not in ('.', '..') \
and not salt.fileserver.is_file_ignored(__opts__, dir_rel_fn):
ret['empty_dirs'].append(dir_rel_fn)
for fname in files:
is_link = os.path.islink(os.path.join(root, fname))