Commit 2acd0318 authored by Mikaël Salson's avatar Mikaël Salson
Browse files

custom: raise an error when there is no fuse server

parent 235ed6f9
......@@ -12,6 +12,7 @@
import defs
import vidjil_utils
import logging
from controller_utils import error_message
import gluon.contrib.simplejson, time, datetime
if request.env.http_origin:
......@@ -250,7 +251,10 @@ def get_custom_data():
error += "you do not have permission to consult this patient ("+str(patient_id)+")"
if error == "" :
data = custom_fuse(request.vars["custom"])
data = custom_fuse(request.vars["custom"])
except IOError, error:
return error_message(str(error))
data["dataFileName"] = "Compare patients"
data["info"] = "Compare patients"
......@@ -317,7 +317,9 @@ def run_fuse(id_file, id_config, id_data, id_fuse, clean_before=True, clean_afte
def custom_fuse(file_list):
import time, datetime, sys, os.path, random, xmlrpclib
from subprocess import Popen, PIPE, STDOUT, os
if defs.PORT_FUSE_SERVER is None:
raise IOError('This server cannot fuse custom data')
random_id = random.randint(99999999,99999999999)
out_folder = defs.DIR_OUT_VIDJIL_ID % random_id
output_filename = defs.BASENAME_OUT_VIDJIL_ID % random_id
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