Avoid copying/symlinking to $sitedir/venv if it already exists.
Review Request #13193 — Created Aug. 8, 2023 and submitted — Latest diff uploaded
We hit a situation during a deployment where
$sitedir/venv
, which
was already a working site directory, was replaced with a symlink to
itself, erasing the entire environment in the process and requiring a
server rebuild.This directory is too important to risk. We don't want to impact it if
it already exists, whether it's the site's virtualenv directory or not.We now skip the copying/symlinking phase if this already exists.
Deployed a new copy of the site and verified it didn't result in the
venv
directory being replaced.