Skip to content

Commit b2bee28

Browse files
committed
clean up fallback to using get_ref in EasyBlock.check_checksums_for
1 parent 6cae9c0 commit b2bee28

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

easybuild/framework/easyblock.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2584,23 +2584,17 @@ def check_checksums_for(self, ent, sub='', source_cnt=None):
25842584
ec_fn = os.path.basename(self.cfg.path)
25852585
checksum_issues = []
25862586

2587-
if isinstance(ent, EasyConfig):
2588-
# try to get value with templates resolved, but fall back to not resolving templates;
2589-
# this is better for error reporting that includes names of source files
2590-
try:
2591-
sources = ent.get('sources', [])
2592-
patches = ent.get('patches', []) + ent.get('postinstallpatches', [])
2593-
checksums = ent.get('checksums', [])
2594-
except EasyBuildError:
2595-
sources = ent.get_ref('sources')
2596-
patches = ent.get_ref('patches') + ent.get_ref('postinstallpatches')
2597-
checksums = ent.get_ref('checksums')
2598-
elif isinstance(ent, dict):
2587+
# try to get value with templates resolved, but fall back to not resolving templates;
2588+
# this is better for error reporting that includes names of source files
2589+
try:
25992590
sources = ent.get('sources', [])
26002591
patches = ent.get('patches', []) + ent.get('postinstallpatches', [])
26012592
checksums = ent.get('checksums', [])
2602-
else:
2603-
raise EasyBuildError(f"Unexpected value type in EasyBlock.check_checksums_for: {type(ent)}")
2593+
except EasyBuildError:
2594+
if isinstance(ent, EasyConfig):
2595+
sources = ent.get_ref('sources')
2596+
patches = ent.get_ref('patches') + ent.get_ref('postinstallpatches')
2597+
checksums = ent.get_ref('checksums')
26042598

26052599
# Single source should be re-wrapped as a list, and checksums with it
26062600
if isinstance(sources, dict):

0 commit comments

Comments
 (0)