From b397ebed2823e6bade08a6b23c5b130904d5410f Mon Sep 17 00:00:00 2001 From: Arie Peterson <arie@greenhost.nl> Date: Thu, 2 Feb 2023 16:16:43 +0100 Subject: [PATCH] Reduce verbosity of backend startup routines --- backend/cluster_config.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/backend/cluster_config.py b/backend/cluster_config.py index 20ec9e98..f814e1c4 100644 --- a/backend/cluster_config.py +++ b/backend/cluster_config.py @@ -13,7 +13,7 @@ def populate_apps(): for app in App.query.all(): slug = app.slug database_apps[slug] = app - logging.info(f"database app: {slug}") + logging.debug(f"database app: {slug}") _populate_apps_from(database_apps, "stackspin-apps") _populate_apps_from(database_apps, "stackspin-apps-custom") @@ -27,19 +27,19 @@ def _populate_apps_from(database_apps, configmap_name): logging.info(f"Could not find configmap '{configmap_name}' in namespace 'flux-system'; ignoring.") else: for app_slug, app_data in cm_apps.items(): - logging.info(f"configmap app: {app_slug}") + logging.debug(f"configmap app: {app_slug}") if app_slug in database_apps: - logging.info(f" already present in database") + logging.debug(f" already present in database") else: - logging.info(f" not present in database, adding!") + logging.debug(f" not present in database, adding!") data = yaml.safe_load(app_data) name = data["name"] - logging.info(f" name: {name}") + logging.debug(f" name: {name}") external = data.get("external", False) - logging.info(f" type external: {type(external)}") - logging.info(f" external: {external}") + logging.debug(f" type external: {type(external)}") + logging.debug(f" external: {external}") url = data.get("url", None) - logging.info(f" url: {url}") + logging.debug(f" url: {url}") new_app = App(slug=app_slug, name=name, external=external, url=url) db.session.add(new_app) db.session.commit() @@ -52,7 +52,7 @@ def populate_oauthclients(): for client in OAuthClientApp.query.all(): id = client.oauthclient_id database_oauthclients[id] = client - logging.info(f"database oauthclient: {id}") + logging.debug(f"database oauthclient: {id}") _populate_oauthclients_from(database_oauthclients, "stackspin-oauthclients") _populate_oauthclients_from(database_oauthclients, "stackspin-oauthclients-custom") @@ -65,11 +65,11 @@ def _populate_oauthclients_from(database_oauthclients, configmap_name): logging.info(f"Could not find configmap '{configmap_name}' in namespace 'flux-system'; ignoring.") else: for client_id, client_app in cm_oauthclients.items(): - logging.info(f"configmap oauthclient: {client_id}") + logging.debug(f"configmap oauthclient: {client_id}") if client_id in database_oauthclients: - logging.info(f" already present in database") + logging.debug(f" already present in database") else: - logging.info(f" not present in database, adding!") + logging.debug(f" not present in database, adding!") # Take the value of the configmap mapping (`client_app`) and # interpret it as the slug of the app that this oauthclient # belongs to. @@ -78,6 +78,6 @@ def _populate_oauthclients_from(database_oauthclients, configmap_name): logging.error(f" could not find app with slug {client_app}") continue new_client = OAuthClientApp(oauthclient_id=client_id, app_id=app.id) - logging.info(f" new oauth client: {new_client}") + logging.debug(f" new oauth client: {new_client}") db.session.add(new_client) db.session.commit() -- GitLab