Skip to content
Snippets Groups Projects
Commit 01ac2b99 authored by Mads M. Pedersen's avatar Mads M. Pedersen
Browse files

bug fix in process_exec

parent 4cb24d2b
No related branches found
No related tags found
No related merge requests found
...@@ -176,7 +176,7 @@ class Simulation(object): ...@@ -176,7 +176,7 @@ class Simulation(object):
assert not src.startswith(".."), "%s referes to a file outside the model path\nAll input files be inside model path" % src assert not src.startswith(".."), "%s referes to a file outside the model path\nAll input files be inside model path" % src
return src return src
input_patterns = [fmt(src) for src in self.htcFile.input_files() + ([], self.htcFile.turbulence_files())[self.copy_turbulence] + self.additional_files().get('input', [])] input_patterns = [fmt(src) for src in self.htcFile.input_files() + ([], self.htcFile.turbulence_files())[self.copy_turbulence] + self.additional_files().get('input', [])]
input_files = set([f for pattern in input_patterns for f in glob.glob(os.path.join(self.modelpath, pattern)) if os.path.isfile(f)]) input_files = set([f for pattern in input_patterns for f in glob.glob(os.path.join(self.modelpath, pattern)) if os.path.isfile(f) and ".hawc2launcher" not in f])
if not os.path.isdir(os.path.dirname(self.modelpath + self.stdout_filename)): if not os.path.isdir(os.path.dirname(self.modelpath + self.stdout_filename)):
os.makedirs(os.path.dirname(self.modelpath + self.stdout_filename)) os.makedirs(os.path.dirname(self.modelpath + self.stdout_filename))
self.host._prepare_simulation(input_files) self.host._prepare_simulation(input_files)
......
...@@ -81,9 +81,10 @@ def unix_filename(filename): ...@@ -81,9 +81,10 @@ def unix_filename(filename):
f_lst = [f_ for f_ in os.listdir(ufn) if f_.lower() == f.lower()] f_lst = [f_ for f_ in os.listdir(ufn) if f_.lower() == f.lower()]
if len(f_lst) > 1: if len(f_lst) > 1:
f_lst = [f_ for f_ in f_lst if f_ == f] f_lst = [f_ for f_ in f_lst if f_ == f]
if len(f_lst) == 0: elif len(f_lst) == 0:
raise IOError("'%s' not found in '%s'" % (f, ufn)) raise IOError("'%s' not found in '%s'" % (f, ufn))
ufn = os.path.join(ufn, f_lst[0]) else: # one match found
ufn = os.path.join(ufn, f_lst[0])
return ufn.replace("\\", "/") return ufn.replace("\\", "/")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment