diff --git a/wetb/hawc2/simulation.py b/wetb/hawc2/simulation.py index 5b93e7dcba028e7e13024ea3ce4a82abe395427d..fce2cc14c6e8180f97fe700a272d450c352a2c0f 100755 --- a/wetb/hawc2/simulation.py +++ b/wetb/hawc2/simulation.py @@ -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 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_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)): os.makedirs(os.path.dirname(self.modelpath + self.stdout_filename)) self.host._prepare_simulation(input_files) diff --git a/wetb/utils/process_exec.py b/wetb/utils/process_exec.py index f9f781ad9b414d92da278bd016e0021726ed2018..9782c2552551b9019021295b920e71d5953e2560 100644 --- a/wetb/utils/process_exec.py +++ b/wetb/utils/process_exec.py @@ -81,9 +81,10 @@ def unix_filename(filename): f_lst = [f_ for f_ in os.listdir(ufn) if f_.lower() == f.lower()] if len(f_lst) > 1: 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)) - ufn = os.path.join(ufn, f_lst[0]) + else: # one match found + ufn = os.path.join(ufn, f_lst[0]) return ufn.replace("\\", "/")