From 67f71697fb817348c40e0bebe1434db898dd6d0a Mon Sep 17 00:00:00 2001 From: Disassembler Date: Fri, 10 Apr 2020 14:07:41 +0200 Subject: [PATCH] Ignore all errors and exceptions raised by update-conf.sh --- usr/lib/python3.8/vmmgr/vmmgr.py | 11 ++++++----- usr/lib/python3.8/vmmgr/wsgiapp.py | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/usr/lib/python3.8/vmmgr/vmmgr.py b/usr/lib/python3.8/vmmgr/vmmgr.py index 6719779..387a66e 100644 --- a/usr/lib/python3.8/vmmgr/vmmgr.py +++ b/usr/lib/python3.8/vmmgr/vmmgr.py @@ -173,14 +173,15 @@ def update_app_config(app_name=None): env['PORT'] = host['port'] env['EMAIL'] = common['email'] env['GMAPS_API_KEY'] = common['gmaps-api-key'] - app_names = [app_name] if app_name else repo_local.get_apps() + app_names = [app_name] if app_name else repo_local.get_apps().keys() for app_name in app_names: install_dir = os.path.join(spoc_config.APPS_DIR, app_name, 'install') script_path = os.path.join(install_dir, 'update-conf.sh') - if os.path.exists(script_path): - app_env = env.copy() - app_env['HOST'] = apps[app_name]['host'] - subprocess.run(script_path, cwd=install_dir, env=app_env) + env['HOST'] = apps[app_name]['host'] + try: + subprocess.run(script_path, cwd=install_dir, env=env) + except: + pass def is_app_started(app_name): # Assume that the main container has always the same name as the app diff --git a/usr/lib/python3.8/vmmgr/wsgiapp.py b/usr/lib/python3.8/vmmgr/wsgiapp.py index b23d733..bd429e2 100644 --- a/usr/lib/python3.8/vmmgr/wsgiapp.py +++ b/usr/lib/python3.8/vmmgr/wsgiapp.py @@ -8,7 +8,7 @@ from math import floor from pkg_resources import parse_version from spoc import repo_online, repo_local from werkzeug.exceptions import HTTPException, NotFound, Unauthorized -from werkzeug.routing import Map, Rule, RequestRedirect +from werkzeug.routing import Map, Rule from werkzeug.utils import redirect from werkzeug.wrappers import Request, Response