remove broken subroutine from app.py
This commit is contained in:
@@ -7,25 +7,6 @@ app = Flask(__name__)
|
|||||||
with open('{{ gpo_yaml_path }}', 'r') as file:
|
with open('{{ gpo_yaml_path }}', 'r') as file:
|
||||||
data = yaml.safe_load(file)
|
data = yaml.safe_load(file)
|
||||||
|
|
||||||
# Debugging output to check the structure of loaded data
|
|
||||||
# print("Loaded YAML data:", data)
|
|
||||||
|
|
||||||
@app.route('/gpos', methods=['GET'])
|
|
||||||
def get_gpos():
|
|
||||||
group_name = request.args.get('group_name')
|
|
||||||
|
|
||||||
if not group_name:
|
|
||||||
return jsonify({"error": "Group name is required"}), 400
|
|
||||||
|
|
||||||
gpos = []
|
|
||||||
for gpo, links in data['configured_gpos'].items():
|
|
||||||
for link in links:
|
|
||||||
if link['ad_group'] == group_name or link['local_group'] == group_name:
|
|
||||||
gpos.append(gpo)
|
|
||||||
break
|
|
||||||
|
|
||||||
return jsonify({"group_name": group_name, "GPOs": gpos})
|
|
||||||
|
|
||||||
@app.route('/gpo', methods=['GET'])
|
@app.route('/gpo', methods=['GET'])
|
||||||
def get_groups():
|
def get_groups():
|
||||||
group_name = request.args.get('group')
|
group_name = request.args.get('group')
|
||||||
|
|||||||
Reference in New Issue
Block a user