mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] add --force to 'yunohost domain remove --remove-apps'
This commit is contained in:
parent
865265ea54
commit
74d956f92b
2 changed files with 12 additions and 6 deletions
|
@ -452,6 +452,10 @@ domain:
|
||||||
full: --remove-apps
|
full: --remove-apps
|
||||||
help: Remove apps installed on the domain
|
help: Remove apps installed on the domain
|
||||||
action: store_true
|
action: store_true
|
||||||
|
-f:
|
||||||
|
full: --force
|
||||||
|
help: Do not ask confirmation to remove apps
|
||||||
|
action: store_true
|
||||||
|
|
||||||
### domain_dns_conf()
|
### domain_dns_conf()
|
||||||
dns-conf:
|
dns-conf:
|
||||||
|
|
|
@ -179,7 +179,8 @@ def domain_remove(operation_logger, domain, remove_apps=False, force=False):
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
domain -- Domain to delete
|
domain -- Domain to delete
|
||||||
remove_apps -- Remove applications installed on the domain
|
remove_apps -- Remove applications installed on the domain
|
||||||
force -- Force the domain removal
|
force -- Force the domain removal and don't not ask confirmation to
|
||||||
|
remove apps if remove_apps is specified
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from yunohost.hook import hook_callback
|
from yunohost.hook import hook_callback
|
||||||
|
@ -211,11 +212,12 @@ def domain_remove(operation_logger, domain, remove_apps=False, force=False):
|
||||||
|
|
||||||
if apps_on_that_domain:
|
if apps_on_that_domain:
|
||||||
if remove_apps:
|
if remove_apps:
|
||||||
answer = msignals.prompt(m18n.n('domain_remove_confirm_apps_removal',
|
if not yes:
|
||||||
apps="\n".join([x[1] for x in apps_on_that_domain]),
|
answer = msignals.prompt(m18n.n('domain_remove_confirm_apps_removal',
|
||||||
answers='y/N'), color="yellow")
|
apps="\n".join([x[1] for x in apps_on_that_domain]),
|
||||||
if answer.upper() != "Y":
|
answers='y/N'), color="yellow")
|
||||||
raise YunohostError("aborting")
|
if answer.upper() != "Y":
|
||||||
|
raise YunohostError("aborting")
|
||||||
|
|
||||||
for app, _ in apps_on_that_domain:
|
for app, _ in apps_on_that_domain:
|
||||||
app_remove(app)
|
app_remove(app)
|
||||||
|
|
Loading…
Add table
Reference in a new issue