Merge pull request #1285 from sagessylu/dev

Add --purge option to "yunohost app remove"
This commit is contained in:
Alexandre Aubin 2021-08-18 19:40:33 +02:00 committed by GitHub
commit 07413e19c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View file

@ -673,7 +673,11 @@ app:
api: DELETE /apps/<app> api: DELETE /apps/<app>
arguments: arguments:
app: app:
help: App to delete help: App to remove
-p:
full: --purge
help: Also remove all application data
action: store_true
### app_upgrade() ### app_upgrade()
upgrade: upgrade:

View file

@ -1189,12 +1189,13 @@ def dump_app_log_extract_for_debugging(operation_logger):
@is_unit_operation() @is_unit_operation()
def app_remove(operation_logger, app): def app_remove(operation_logger, app, purge=False):
""" """
Remove app Remove app
Keyword argument: Keyword arguments:
app -- App(s) to delete app -- App(s) to delete
purge -- Remove with all app data
""" """
from yunohost.hook import hook_exec, hook_remove, hook_callback from yunohost.hook import hook_exec, hook_remove, hook_callback
@ -1232,6 +1233,7 @@ def app_remove(operation_logger, app):
env_dict["YNH_APP_INSTANCE_NAME"] = app env_dict["YNH_APP_INSTANCE_NAME"] = app
env_dict["YNH_APP_INSTANCE_NUMBER"] = str(app_instance_nb) env_dict["YNH_APP_INSTANCE_NUMBER"] = str(app_instance_nb)
env_dict["YNH_APP_MANIFEST_VERSION"] = manifest.get("version", "?") env_dict["YNH_APP_MANIFEST_VERSION"] = manifest.get("version", "?")
env_dict["YNH_APP_PURGE"] = purge
operation_logger.extra.update({"env": env_dict}) operation_logger.extra.update({"env": env_dict})
operation_logger.flush() operation_logger.flush()