apps: Fix edge case in change_url where old_nginx_conf_backup could be None

This commit is contained in:
Alexandre Aubin 2023-02-20 20:50:53 +01:00 committed by GitHub
parent 95b80b056f
commit e1d62a1910
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -508,8 +508,9 @@ def app_change_url(operation_logger, app, domain, path):
new_nginx_conf_path
):
rm(new_nginx_conf_path, force=True)
write_to_file(old_nginx_conf_path, old_nginx_conf_backup)
service_reload_or_restart("nginx")
if old_nginx_conf_backup:
write_to_file(old_nginx_conf_path, old_nginx_conf_backup)
service_reload_or_restart("nginx")
# restore values modified by app_checkurl
# see begining of the function