diff --git a/rootfs/standard/var/www/mynode/device_info.py b/rootfs/standard/var/www/mynode/device_info.py index 915d50cb..91c5c645 100644 --- a/rootfs/standard/var/www/mynode/device_info.py +++ b/rootfs/standard/var/www/mynode/device_info.py @@ -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() diff --git a/rootfs/standard/var/www/mynode/settings.py b/rootfs/standard/var/www/mynode/settings.py index 0ce133bb..e9e7cfc9 100644 --- a/rootfs/standard/var/www/mynode/settings.py +++ b/rootfs/standard/var/www/mynode/settings.py @@ -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")