Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

follow symlinks while discovering valid playbooks #6773

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
follow symlinks while discovering valid playbooks
related: #6769

Co-authored-by: Francois Herbert <francois@herbert.org.nz>
  • Loading branch information
ryanpetrello and fherbert committed Apr 22, 2020
commit 3dd21d720eb5351e63f9f31c4e601a67965dac56
2 changes: 1 addition & 1 deletion awx/main/models/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def playbooks(self):
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:
Expand Down
1 change: 1 addition & 0 deletions awx/main/utils/ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you test this with a directory loop instead of a file loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, on it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine:

image

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

image

return None
if not matched:
return None
Expand Down