mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
yunohost.domain: Fix domain removing if app has no 'domain' setting
This commit is contained in:
parent
d766ed5a5e
commit
30d6ace802
1 changed files with 7 additions and 2 deletions
|
@ -256,8 +256,13 @@ def domain_remove(auth, domains):
|
|||
# Check if apps are installed on the domain
|
||||
for app in os.listdir('/etc/yunohost/apps/'):
|
||||
with open('/etc/yunohost/apps/' + app +'/settings.yml') as f:
|
||||
if yaml.load(f)['domain'] == domain:
|
||||
raise MoulinetteError(1, _("One or more apps are installed on this domain, please uninstall them before proceed to domain removal"))
|
||||
try:
|
||||
app_domain = yaml.load(f)['domain']
|
||||
except:
|
||||
continue
|
||||
else:
|
||||
if app_domain == domain:
|
||||
raise MoulinetteError(1, _("One or more apps are installed on this domain, please uninstall them before proceed to domain removal"))
|
||||
|
||||
if auth.remove('virtualdomain=' + domain + ',ou=domains'):
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue