@@ -3072,21 +3072,24 @@ def post_install_step(self):
30723072 # create *relative* 'lib' symlink to 'lib64';
30733073 symlink ('lib64' , lib_dir , use_abspath_source = False )
30743074
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+
30753082 def sanity_check_step (self , * args , ** kwargs ):
30763083 """
30773084 Do a sanity check on the installation
30783085 - if *any* of the files/subdirectories in the installation directory listed
30793086 in sanity_check_paths are non-existent (or empty), the sanity check fails
30803087 """
3081- if self .dry_run :
3082- self ._sanity_check_step_dry_run (* args , ** kwargs )
3083-
30843088 # 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 :
30863090 self ._sanity_check_step_multi_deps (* args , ** kwargs )
3087-
30883091 else :
3089- self ._sanity_check_step (* args , ** kwargs )
3092+ self ._dispatch_sanity_check_step (* args , ** kwargs )
30903093
30913094 def _sanity_check_step_multi_deps (self , * args , ** kwargs ):
30923095 """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):
31183121 self .log .info (info_msg )
31193122
31203123 kwargs ['extra_modules' ] = extra_modules
3121- self ._sanity_check_step (* args , ** kwargs )
3124+ self ._dispatch_sanity_check_step (* args , ** kwargs )
31223125
31233126 # restore list of lists of build dependencies & stop iterating again
31243127 self .cfg ['builddependencies' ] = builddeps
@@ -3379,14 +3382,13 @@ def _sanity_check_step_common(self, custom_paths, custom_commands):
33793382 # if enhance_sanity_check is enabled *and* sanity_check_paths are specified in the easyconfig,
33803383 # those paths are used to enhance the paths provided by the easyblock
33813384 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 ():
33843386 if isinstance (val , list ):
33853387 paths [key ] = paths .get (key , []) + val
33863388 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 )
33903392 self .log .info ("Enhanced sanity check paths after taking into account easyconfig file: %s" , paths )
33913393
33923394 sorted_keys = sorted (paths .keys ())
0 commit comments