Commit 1b38b183 authored by Penom Nom's avatar Penom Nom
Browse files

Correction of a bug when running addanalysis with quote in a string

parent 83580524
...@@ -107,7 +107,7 @@ class Workflow(threading.Thread): ...@@ -107,7 +107,7 @@ class Workflow(threading.Thread):
@staticmethod @staticmethod
def config_parser(arg_lines): def config_parser(arg_lines):
for arg in arg_lines: for arg in arg_lines:
yield arg.strip("'").strip('"') yield arg
def __setstate__(self, state): def __setstate__(self, state):
self.__dict__ = state.copy() self.__dict__ = state.copy()
...@@ -345,7 +345,7 @@ class Workflow(threading.Thread): ...@@ -345,7 +345,7 @@ class Workflow(threading.Thread):
params, sub_order, excludes, hash_params = {}, {}, [], {} params, sub_order, excludes, hash_params = {}, {}, [], {}
# first grab all parameters name # first grab all parameters name
for param in reader.items(parameters_section): for param in reader.items(parameters_section):
cvalue = reader.get(parameters_section, param[0]).strip("'").strip('"') cvalue = reader.get(parameters_section, param[0])
cparam = param[0].split(".")[0] cparam = param[0].split(".")[0]
ckey = ".".join(param[0].split(".")[1:]) ckey = ".".join(param[0].split(".")[1:])
if len(ckey.split(".")) > 1: if len(ckey.split(".")) > 1:
......
...@@ -473,9 +473,9 @@ class t3MySQLdb(object): ...@@ -473,9 +473,9 @@ class t3MySQLdb(object):
else : analysis_is_editable = 0 else : analysis_is_editable = 0
req = "INSERT INTO tx_nG6_analyze (pid,tstamp,crdate,cruser_id,class,name,description,date,directory,software,version," req = "INSERT INTO tx_nG6_analyze (pid,tstamp,crdate,cruser_id,class,name,description,date,directory,software,version,"
req += "hidden, params, is_editable, parent_uid) VALUES ('" + str(self.cfg_reader.get_pid())+ "','" + str(crdate) + "','" req += "hidden, params, is_editable, parent_uid) VALUES ('" + str(self.cfg_reader.get_pid())+ "','" + str(crdate) + "','"
req += str(crdate) + "'," + str(cruser_id) + ",'" + aclass + "','" + name.replace("'", "\'") + "','" + description.replace("'", "\'") + "','" req += str(crdate) + "'," + str(cruser_id) + ",'" + aclass + "','" + name.replace("'", "\\'") + "','" + description.replace("'", "\\'") + "','"
req += str(crdate) + "','" + directory + "','" + software.replace("'", "\'") + "','" req += str(crdate) + "','" + directory + "','" + software.replace("'", "\\'") + "','"
req += version.replace("'", "\'") + "','" + str(hidden) + "','" + params.replace("'", "\'") + "','" req += version.replace("'", "\\'") + "','" + str(hidden) + "','" + params.replace("'", "\\'") + "','"
req += str(analysis_is_editable) + "','" + str(parent_uid) + "')" req += str(analysis_is_editable) + "','" + str(parent_uid) + "')"
curs.execute(req) curs.execute(req)
analysis_id = conn.insert_id() analysis_id = conn.insert_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