mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-26 17:40:33 +00:00
update manage.py
This commit is contained in:
parent
f9972a9abb
commit
a55511b016
1 changed files with 16 additions and 18 deletions
|
@ -176,26 +176,24 @@ def uninstall_app(app_id):
|
|||
ret = Response(code=const.RETURN_FAIL, message="")
|
||||
if docker.check_app_id(app_id):
|
||||
app_name = split_app_id(app_id)
|
||||
info, code = if_app_exits(app_id)
|
||||
if code:
|
||||
app_path = info.split()[-1].rsplit('/', 1)[0]
|
||||
if_stopped = stop_app(app_id) # stop_app
|
||||
app_name = split_app_id(app_id)
|
||||
if if_stopped["code"] == 0:
|
||||
cmd = "docker compose -f " + app_path + "/docker-compose.yml down -v"
|
||||
lib_path = '/data/library/apps/' + app_name
|
||||
if app_path != lib_path:
|
||||
cmd = cmd + " && sudo rm -rf " + app_path
|
||||
output = shell_execute.execute_command_output_all(cmd)
|
||||
if int(output["code"]) == 0:
|
||||
ret.code = 0
|
||||
ret.message = "The app is deleted successfully"
|
||||
else:
|
||||
ret.message = "App deletion failed!"
|
||||
app_path = info.split()[-1].rsplit('/', 1)[0]
|
||||
if_stopped = stop_app(app_id) # stop_app
|
||||
app_name = split_app_id(app_id)
|
||||
if if_stopped["code"] == 0:
|
||||
cmd = "docker compose -f " + app_path + "/docker-compose.yml down -v"
|
||||
lib_path = '/data/library/apps/' + app_name
|
||||
if app_path != lib_path:
|
||||
cmd = cmd + " && sudo rm -rf " + app_path
|
||||
output = shell_execute.execute_command_output_all(cmd)
|
||||
if int(output["code"]) == 0:
|
||||
ret.code = 0
|
||||
ret.message = "The app is deleted successfully"
|
||||
else:
|
||||
ret.message = if_stopped["message"]
|
||||
ret.message = "App deletion failed!"
|
||||
else:
|
||||
ret.message = 'AppID is not legal!'
|
||||
ret.message = if_stopped["message"]
|
||||
else:
|
||||
ret.message = 'AppID is not legal!'
|
||||
ret = ret.dict()
|
||||
return ret
|
||||
|
||||
|
|
Loading…
Reference in a new issue