Commit 77b4c658 authored by Davide Lagoa's avatar Davide Lagoa
Browse files

methods to get configurations added

parent 3787a339
......@@ -2,7 +2,6 @@
from flask import Flask, render_template, request, send_file, jsonify
from logging.handlers import TimedRotatingFileHandler
import FilesUtilities
import FilesUtilities
import os
import socket
import shutil
......@@ -272,6 +271,24 @@ def download(submissionID):
return send_file(RESULTS_PATH + submissionID + "/", as_attachment=True,
attachment_filename='results' + timestr + '.zip')
def configsRetriever():"Request to get configurations")
dic = {}
for key in CONFIGURATIONS.keys():
if "password" not in key:
dic[key] = CONFIGURATIONS[key]
return jsonify(dic), 200
def retrieveWorkersAdresses():"Request to get workers addresses")
workers = FilesUtilities.read_workers_conf_file('/configs/workers_addresses.conf')
return jsonify({"workers_addresses":workers}), 200
def logsRetriever(level):
......@@ -426,4 +443,4 @@'Server running!')
if __name__ == "__main__":["flask_host"], port=int(CONFIGURATIONS["flask_port"]), threaded=True, debug=False)
app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment