Avoid copying/symlinking to $sitedir/venv if it already exists.

Review Request #13193 — Created Aug. 8, 2023 and submitted

Information

Review Board
release-6.x

Reviewers

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.

Summary ID
Avoid copying/symlinking to $sitedir/venv if it already exists.
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.
c4cc00f23575ffd82ddb023a9901f6645372043e
david
  1. Ship It!
  2. 
      
maubin
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-6.x (54eee2e)