follow symlinks while discovering valid playbooks

related: https://github.com/ansible/awx/pull/6769

Co-authored-by: Francois Herbert <francois@herbert.org.nz>
This commit is contained in:
Ryan Petrello 2020-04-21 10:49:05 -04:00
parent 9cfecb5590
commit 3dd21d720e
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777
2 changed files with 2 additions and 1 deletions

View File

@ -199,7 +199,7 @@ class ProjectOptions(models.Model):
results = []
project_path = self.get_project_path()
if project_path:
for dirpath, dirnames, filenames in os.walk(smart_str(project_path)):
for dirpath, dirnames, filenames in os.walk(smart_str(project_path), followlinks=True):
if skip_directory(dirpath):
continue
for filename in filenames:

View File

@ -64,6 +64,7 @@ def could_be_playbook(project_path, dir_path, filename):
matched = True
break
except IOError:
logger.exception(f'failed to open {playbook_path}')
return None
if not matched:
return None