Skip hidden dirs in genrepo

This commit is contained in:
twangboy 2018-02-05 16:51:22 -07:00
parent 87dc554dc3
commit 437a457911
No known key found for this signature in database
GPG key ID: 93FF3BDEB278C9EB

View file

@ -838,6 +838,10 @@ def genrepo(**kwargs):
to process. If ``False``, no error will be raised, and a dictionary
containing the full results will be returned.
.. note::
- Hidden directories (directories beginning with '`.`', such as
'`.git`') will be ignored.
Returns:
dict: A dictionary of the results of the command
@ -864,6 +868,10 @@ def genrepo(**kwargs):
short_path = os.path.relpath(root, repo_details.local_dest)
if short_path == '.':
short_path = ''
if re.search(r'[\\/]\..*', root):
log.debug('Skipping files in directory: {0}'.format(root))
continue
for name in files:
if name.endswith('.sls'):
total_files_processed += 1