Commit 71a5fb8f authored by Jerome Mariette's avatar Jerome Mariette
Browse files

get_exec_path handle sub execution files

parent 2f789d18
...@@ -138,10 +138,14 @@ class Component(object): ...@@ -138,10 +138,14 @@ class Component(object):
exec_path = os.path.join(os.path.dirname(inspect.getfile(self.__class__)), "../bin", software) exec_path = os.path.join(os.path.dirname(inspect.getfile(self.__class__)), "../bin", software)
elif exec_path is None and os.path.isfile(os.path.join(os.path.dirname(inspect.getfile(self.__class__)), "bin", software)): elif exec_path is None and os.path.isfile(os.path.join(os.path.dirname(inspect.getfile(self.__class__)), "bin", software)):
exec_path = os.path.join(os.path.dirname(inspect.getfile(self.__class__)), "bin", software) exec_path = os.path.join(os.path.dirname(inspect.getfile(self.__class__)), "bin", software)
if exec_path is None and which(software) == None: elif exec_path is None and which(software) == None:
sys.stderr.write("Error: '" + software + "' path connot be retrieved either in the PATH and in the application.properties file!\n") sys.stderr.write("Error: '" + software + "' path connot be retrieved either in the PATH and in the application.properties file!\n")
sys.exit(1) sys.exit(1)
else: exec_path = software elif exec_path is None and which(software) != None:
exec_path = software
elif exec_path != None and not os.path.isfile(exec_path):
sys.stderr.write("Error: '" + exec_path + "' set for '" + software + "' does not exists, please provide a valid path!\n")
sys.exit(1)
return exec_path return exec_path
def get_nameid(self): def get_nameid(self):
......
...@@ -184,10 +184,14 @@ class Workflow(threading.Thread): ...@@ -184,10 +184,14 @@ class Workflow(threading.Thread):
exec_path = os.path.join(os.path.dirname(inspect.getfile(self.__class__)), "../bin", software) exec_path = os.path.join(os.path.dirname(inspect.getfile(self.__class__)), "../bin", software)
elif exec_path is None and os.path.isfile(os.path.join(os.path.dirname(inspect.getfile(self.__class__)), "bin", software)): elif exec_path is None and os.path.isfile(os.path.join(os.path.dirname(inspect.getfile(self.__class__)), "bin", software)):
exec_path = os.path.join(os.path.dirname(inspect.getfile(self.__class__)), "bin", software) exec_path = os.path.join(os.path.dirname(inspect.getfile(self.__class__)), "bin", software)
if exec_path is None and utils.which(software) == None: elif exec_path is None and utils.which(software) == None:
sys.stderr.write("Error: '" + software + "' path connot be retrieved either in the PATH and in the application.properties file!\n") sys.stderr.write("Error: '" + software + "' path connot be retrieved either in the PATH and in the application.properties file!\n")
sys.exit(1) sys.exit(1)
else: exec_path = software elif exec_path is None and utils.which(software) != None:
exec_path = software
elif exec_path != None and not os.path.isfile(exec_path):
sys.stderr.write("Error: '" + exec_path + "' set for '" + software + "' does not exists, please provide a valid path!\n")
sys.exit(1)
return exec_path return exec_path
def add_component(self, component_name, args=[], kwargs={}, component_prefix="default"): def add_component(self, component_name, args=[], kwargs={}, component_prefix="default"):
......
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