create-production-venv: Fix symlink creation.

The install script was failing on 2nd+ attempts if the first attempt
was interrupted.

This failure happened because zulip-venv already existed at
`current_venv_path`. Changing the `ln` command's flags from `-s` to
`-nsf` should make this part of the script idempotent.
This commit is contained in:
theopen-institute
2017-05-21 07:56:51 +05:45
committed by Tim Abbott
parent a2f5d133e8
commit 7eaa1fa0d0

View File

@@ -32,5 +32,5 @@ cached_venv_path = setup_virtualenv(
virtualenv_args=['-p', 'python{}'.format(python_version)]) virtualenv_args=['-p', 'python{}'.format(python_version)])
current_venv_path = os.path.join(args.deploy_path, 'zulip-current-venv') current_venv_path = os.path.join(args.deploy_path, 'zulip-current-venv')
run(['ln', '-s', venv_name, current_venv_path]) run(['ln', '-nsf', venv_name, current_venv_path])
# Now the virtualenv has been activated # Now the virtualenv has been activated