fix a few bugs with app del uninstall and deletion
This commit is contained in:
parent
2e55e2fa39
commit
82478e5006
3 changed files with 18 additions and 6 deletions
|
|
@ -98,9 +98,14 @@ def delete_app(slug):
|
|||
current_app.logger.info("Not found")
|
||||
return
|
||||
|
||||
deleted = app_obj.delete()
|
||||
current_app.logger.info(f"Success: {deleted}")
|
||||
return
|
||||
app_status = app_obj.get_status()
|
||||
if not app_status.installed:
|
||||
deleted = app_obj.delete()
|
||||
current_app.logger.info(f"Success.")
|
||||
else:
|
||||
current_app.logger.info("Can not delete installed application, run"
|
||||
" 'uninstall' first")
|
||||
|
||||
|
||||
@app_cli.command(
|
||||
"uninstall",
|
||||
|
|
@ -110,7 +115,7 @@ def uninstall_app(slug):
|
|||
"""Uninstalls the app from the cluster
|
||||
:param slug: str Slug of app to remove
|
||||
"""
|
||||
current_app.logger.info(f"Trying to delete app: {slug}")
|
||||
current_app.logger.info(f"Trying to uninstall app: {slug}")
|
||||
app_obj = App.query.filter_by(slug=slug).first()
|
||||
|
||||
if not app_obj:
|
||||
|
|
@ -152,7 +157,7 @@ def install_app(slug):
|
|||
return
|
||||
|
||||
current_status = app.get_status()
|
||||
if current_status.installed == False:
|
||||
if not current_status.installed:
|
||||
app.install()
|
||||
current_app.logger.info(
|
||||
f"App {slug} installing... use `status` to see status")
|
||||
|
|
|
|||
Reference in a new issue