mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-12-25 14:08:07 +00:00
Fix issue where status page wouldn't load without drive attached
This commit is contained in:
parent
1f74ae67c7
commit
beef323e0b
|
@ -793,6 +793,12 @@ def reset_docker():
|
|||
|
||||
def get_docker_running_containers():
|
||||
containers = []
|
||||
|
||||
# If docker not running, return empty
|
||||
if get_service_status_code("docker") != 0:
|
||||
return containers
|
||||
|
||||
# TODO: switch to subprocess after switch to python3 for web ui (timeout doesn't work w/ subprocess32, causes issues)
|
||||
try:
|
||||
text = subprocess32.check_output("docker ps --format '{{.Names}}'", shell=True, timeout=3).decode("utf8")
|
||||
containers = text.splitlines()
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from config import *
|
||||
from flask import Blueprint, render_template, session, abort, Markup, request, redirect, send_from_directory, url_for, flash, current_app
|
||||
from flask import Blueprint, render_template, session, abort, Markup, request, redirect, send_from_directory, url_for, flash
|
||||
from flask import current_app as app
|
||||
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
|
||||
from bitcoin import is_bitcoin_synced
|
||||
from bitcoin_info import using_bitcoin_custom_config
|
||||
|
@ -848,13 +849,13 @@ def reinstall_app_page():
|
|||
return redirect("/settings")
|
||||
|
||||
# Check application name is valid
|
||||
app = request.args.get("app")
|
||||
if not is_application_valid(app):
|
||||
app_name = request.args.get("app")
|
||||
if not is_application_valid(app_name):
|
||||
flash("Application is invalid", category="error")
|
||||
return redirect("/settings")
|
||||
|
||||
# Re-install app
|
||||
t = Timer(1.0, reinstall_app, [app])
|
||||
t = Timer(1.0, reinstall_app, [app_name])
|
||||
t.start()
|
||||
|
||||
# Display wait page
|
||||
|
@ -877,13 +878,13 @@ def uninstall_app_page():
|
|||
return redirect("/apps")
|
||||
|
||||
# Check application name is valid
|
||||
app = request.args.get("app")
|
||||
if not is_application_valid(app):
|
||||
app_name = request.args.get("app")
|
||||
if not is_application_valid(app_name):
|
||||
flash("Application is invalid", category="error")
|
||||
return redirect("/apps")
|
||||
|
||||
# Un-install app
|
||||
uninstall_app(app)
|
||||
uninstall_app(app_name)
|
||||
|
||||
flash("Application Uninstalled", category="message")
|
||||
return redirect("/apps")
|
||||
|
|
Loading…
Reference in New Issue
Block a user