@@ -3072,21 +3072,24 @@ def post_install_step(self):
3072
3072
# create *relative* 'lib' symlink to 'lib64';
3073
3073
symlink ('lib64' , lib_dir , use_abspath_source = False )
3074
3074
3075
+ def _dispatch_sanity_check_step (self , * args , ** kwargs ):
3076
+ """Decide whether to run the dry-run or the real version of the sanity-check step"""
3077
+ if self .dry_run :
3078
+ self ._sanity_check_step_dry_run (* args , ** kwargs )
3079
+ else :
3080
+ self ._sanity_check_step (* args , ** kwargs )
3081
+
3075
3082
def sanity_check_step (self , * args , ** kwargs ):
3076
3083
"""
3077
3084
Do a sanity check on the installation
3078
3085
- if *any* of the files/subdirectories in the installation directory listed
3079
3086
in sanity_check_paths are non-existent (or empty), the sanity check fails
3080
3087
"""
3081
- if self .dry_run :
3082
- self ._sanity_check_step_dry_run (* args , ** kwargs )
3083
-
3084
3088
# handling of extensions that were installed for multiple dependency versions is done in ExtensionEasyBlock
3085
- elif self .cfg ['multi_deps' ] and not self .is_extension :
3089
+ if self .cfg ['multi_deps' ] and not self .is_extension :
3086
3090
self ._sanity_check_step_multi_deps (* args , ** kwargs )
3087
-
3088
3091
else :
3089
- self ._sanity_check_step (* args , ** kwargs )
3092
+ self ._dispatch_sanity_check_step (* args , ** kwargs )
3090
3093
3091
3094
def _sanity_check_step_multi_deps (self , * args , ** kwargs ):
3092
3095
"""Perform sanity check for installations that iterate over a list a versions for particular dependencies."""
@@ -3118,7 +3121,7 @@ def _sanity_check_step_multi_deps(self, *args, **kwargs):
3118
3121
self .log .info (info_msg )
3119
3122
3120
3123
kwargs ['extra_modules' ] = extra_modules
3121
- self ._sanity_check_step (* args , ** kwargs )
3124
+ self ._dispatch_sanity_check_step (* args , ** kwargs )
3122
3125
3123
3126
# restore list of lists of build dependencies & stop iterating again
3124
3127
self .cfg ['builddependencies' ] = builddeps
@@ -3379,14 +3382,13 @@ def _sanity_check_step_common(self, custom_paths, custom_commands):
3379
3382
# if enhance_sanity_check is enabled *and* sanity_check_paths are specified in the easyconfig,
3380
3383
# those paths are used to enhance the paths provided by the easyblock
3381
3384
if enhance_sanity_check and ec_paths :
3382
- for key in ec_paths :
3383
- val = ec_paths [key ]
3385
+ for key , val in ec_paths .items ():
3384
3386
if isinstance (val , list ):
3385
3387
paths [key ] = paths .get (key , []) + val
3386
3388
else :
3387
- error_pattern = "Incorrect value type in sanity_check_paths, should be a list: "
3388
- error_pattern += "%s (type: %s)" % (val , type (val ))
3389
- raise EasyBuildError (error_pattern )
3389
+ error_msg = "Incorrect value type in sanity_check_paths, should be a list: "
3390
+ error_msg += "%s (type: %s)" % (val , type (val ))
3391
+ raise EasyBuildError (error_msg )
3390
3392
self .log .info ("Enhanced sanity check paths after taking into account easyconfig file: %s" , paths )
3391
3393
3392
3394
sorted_keys = sorted (paths .keys ())
0 commit comments