mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
domain remove: Improve file/folder cleanup code
This commit is contained in:
parent
46b51b84f3
commit
808a69ca64
1 changed files with 11 additions and 10 deletions
|
@ -281,13 +281,14 @@ def domain_remove(operation_logger, domain, remove_apps=False, force=False):
|
|||
except Exception as e:
|
||||
raise YunohostError("domain_deletion_failed", domain=domain, error=e)
|
||||
|
||||
os.system("rm -rf /etc/yunohost/certs/%s" % domain)
|
||||
stuff_to_delete = [
|
||||
f"/etc/yunohost/certs/{domain}",
|
||||
f"/etc/yunohost/dyndns/K{domain}.+*",
|
||||
f"{DOMAIN_SETTINGS_DIR}/{domain}.yml",
|
||||
]
|
||||
|
||||
# Delete dyndns keys for this domain (if any)
|
||||
os.system("rm -rf /etc/yunohost/dyndns/K%s.+*" % domain)
|
||||
|
||||
# Delete settings file for this domain
|
||||
os.system(f"rm -rf {DOMAIN_SETTINGS_DIR}/{domain}.yml")
|
||||
for stuff in stuff_to_delete:
|
||||
os.system("rm -rf {stuff}")
|
||||
|
||||
# Sometime we have weird issues with the regenconf where some files
|
||||
# appears as manually modified even though they weren't touched ...
|
||||
|
|
Loading…
Add table
Reference in a new issue