Skip to content

Commit 9ef09dc

Browse files
committed
Avoid failure when only some passed easyconfigs exist
When processing multiple EasyConfigs where one does not exist `samefile` will abort with a `FileNotFoundError`. So move the existance check to the top of the loop.
1 parent 6de3eb6 commit 9ef09dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

easybuild/framework/easyconfig/tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,8 @@ def parse_easyconfigs(paths, validate=True):
406406
parsed_paths = []
407407

408408
for (path, generated) in paths:
409+
if not os.path.exists(path):
410+
raise EasyBuildError("Can't find path %s", path, exit_code=EasyBuildExit.MISSING_EASYCONFIG)
409411
# Avoid processing the same file multiple times
410412
path = os.path.abspath(path)
411413
if any(os.path.samefile(path, p) for p in parsed_paths):
@@ -414,8 +416,6 @@ def parse_easyconfigs(paths, validate=True):
414416

415417
# keep track of whether any files were generated
416418
generated_ecs |= generated
417-
if not os.path.exists(path):
418-
raise EasyBuildError("Can't find path %s", path, exit_code=EasyBuildExit.MISSING_EASYCONFIG)
419419
try:
420420
ec_files = find_easyconfigs(path, ignore_dirs=build_option('ignore_dirs'))
421421
for ec_file in ec_files:

0 commit comments

Comments
 (0)