From 999e8720eecf6b1cae7a2e72ef48b4d2372d4d9a Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 3 Nov 2026 03:02:57 -0800 Subject: [PATCH] add reload button remove comments --- templates/app.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/templates/app.py b/templates/app.py index d3ba27d..5205019 100644 --- a/templates/app.py +++ b/templates/app.py @@ -5,24 +5,18 @@ from flask import Flask, request, jsonify, abort import threading app = Flask(__name__) -### adding reload route + # Global cache and lock data = None _data_lock = threading.Lock() - def load_yaml(): """Load the YAML file and return its contents.""" with open('{{ gpo_yaml_path }}', 'r', encoding='utf-8') as f: return yaml.safe_load(f) - # Load GPO data with _data_lock: data = load_yaml() -# O.G. method -#with open('{{ gpo_yaml_path }}', 'r') as file: -# data = yaml.safe_load(file) - def strip_dn(dn: str, base_suffix: str = ",OU=Manufacturing,OU=Tesla Systems,DC=teslamotors,DC=com") -> str: suffix = base_suffix.strip() dn_clean = dn.strip() @@ -160,10 +154,6 @@ def reload_index(): 'gpo_links': data[0]['gpo_links'] }) -# with open('{{ gpo_yaml_path }}', 'r') as file: -# data = yaml.safe_load(file) -# return jsonify({'status': 'reloaded', 'data': data}) - # test route @app.route('/test', methods=['GET']) def test():