Handle optimal builds; remove need for a naming convention
throw errors on bad jsons at start time of server
This commit is contained in:
1 parent
df2b0fb0a3
commit
fd1fa723d5
3 files changed
+66
-22
No files matched your search
+7
-3
@@ -18,12 +18,16 @@
|
||||
# #
|
||||
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
||||
|
||||
import json, os.path
|
||||
import json, os.path, sys
|
||||
from OpenSite.settings import PROJECT_PATH
|
||||
|
||||
def load_json_config(*path):
|
||||
with open(os.path.join(PROJECT_PATH, *path)) as fin:
|
||||
return json.load(fin)
|
||||
try:
|
||||
with open(os.path.join(PROJECT_PATH, *path)) as fin:
|
||||
return json.load(fin)
|
||||
except:
|
||||
print ('Error reading ', path)
|
||||
sys.exit()
|
||||
|
||||
def load_folder_of_configs(*path):
|
||||
return {
|
||||
|
||||
@@ -590,6 +590,7 @@ def client_get_build_info(request):
|
||||
data = {}
|
||||
for engine, config in OPENBENCH_CONFIG['engines'].items():
|
||||
data[engine] = config['build']
|
||||
data[engine]['private'] = config['private']
|
||||
return JsonResponse(data)
|
||||
|
||||
@csrf_exempt
|
||||
|
||||
Reference in new issue
Block a user