mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Removed "useless" venv backup
This commit is contained in:
parent
3e4b88322d
commit
fc0266a62e
1 changed files with 1 additions and 10 deletions
|
@ -30,7 +30,6 @@ N_CURRENT_YUNOHOST = 4
|
||||||
N_NEXT_DEBAN = 11
|
N_NEXT_DEBAN = 11
|
||||||
N_NEXT_YUNOHOST = 11
|
N_NEXT_YUNOHOST = 11
|
||||||
|
|
||||||
VENV_BACKUP_SUFFIX = "_BACKUP_VENV"
|
|
||||||
VENV_REQUIREMENTS_SUFFIX = "_req.txt"
|
VENV_REQUIREMENTS_SUFFIX = "_req.txt"
|
||||||
VENV_IGNORE = "ynh_migration_no_regen"
|
VENV_IGNORE = "ynh_migration_no_regen"
|
||||||
|
|
||||||
|
@ -64,15 +63,7 @@ def _rebuild_venvs():
|
||||||
|
|
||||||
venvs = _get_all_venvs("/opt/")+_get_all_venvs("/var/www/")
|
venvs = _get_all_venvs("/opt/")+_get_all_venvs("/var/www/")
|
||||||
for venv in venvs:
|
for venv in venvs:
|
||||||
# Create a backup of the venv, in case there's a problem
|
if os.path.isfile(venv+VENV_REQUIREMENTS_SUFFIX):
|
||||||
if os.path.isdir(venv+VENV_BACKUP_SUFFIX):
|
|
||||||
rm(venv+VENV_BACKUP_SUFFIX, recursive=True)
|
|
||||||
backup = True
|
|
||||||
try:
|
|
||||||
cp(venv, venv+VENV_BACKUP_SUFFIX, recursive=True)
|
|
||||||
except:
|
|
||||||
backup = False
|
|
||||||
if backup and os.path.isfile(venv+VENV_REQUIREMENTS_SUFFIX):
|
|
||||||
# Recreate the venv
|
# Recreate the venv
|
||||||
rm(venv, recursive=True)
|
rm(venv, recursive=True)
|
||||||
os.system(f"python -m venv {venv}")
|
os.system(f"python -m venv {venv}")
|
||||||
|
|
Loading…
Add table
Reference in a new issue