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

respect home directory symlinks for BASE_VENV_PATH #6152

Merged
Merged
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
2 changes: 1 addition & 1 deletion awx/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
SCHEDULE_METADATA_LOCATION = '/var/lib/awx/.tower_cycle'

# Ansible base virtualenv paths and enablement
BASE_VENV_PATH = "/var/lib/awx/venv"
BASE_VENV_PATH = os.path.realpath("/var/lib/awx/venv")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

bwrap won't follow symlinks

Copy link
Contributor

Choose a reason for hiding this comment

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

why here instead of where it's used later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@ryanpetrello ryanpetrello Mar 5, 2020

Choose a reason for hiding this comment

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

But really, there's a few other places where this setting is utilized (like in the code where we look for custom venvs).

Also, this patch comes from the field; @gamuniz had a user complaining about this issue apply this patch to production.py and it resolved their issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

yep safest place is top level, unless you're saying we should change it everywhere? The user I helped with this setting has reported it fixed their issue

Copy link
Contributor

Choose a reason for hiding this comment

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

Just saying, this only works if /var/lib/awx or /var/lib/awx/venv is a symlink. If there are symlinks in that dir, it will still fail.

Copy link
Contributor

Choose a reason for hiding this comment

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

ahh. Yeah i think if the use-case is to use another directory for venvs we could use the custom_venv_paths, this fix is for those who have their home directory symlinked

ANSIBLE_VENV_PATH = os.path.join(BASE_VENV_PATH, "ansible")

# Tower base virtualenv paths and enablement
Expand Down