modules : it's possible to add suffixes to module files based on constraint
This commit is contained in:
		@@ -287,6 +287,7 @@
 | 
			
		||||
                    'prerequisites': {'$ref': '#/definitions/dependency_selection'},
 | 
			
		||||
                    'conflict': {'$ref': '#/definitions/array_of_strings'},
 | 
			
		||||
                    'load': {'$ref': '#/definitions/array_of_strings'},
 | 
			
		||||
                    'suffixes': {'$ref': '#/definitions/dictionary_of_strings'},
 | 
			
		||||
                    'environment': {
 | 
			
		||||
                        'type': 'object',
 | 
			
		||||
                        'default': {},
 | 
			
		||||
 
 | 
			
		||||
@@ -285,11 +285,18 @@ def use_name(self):
 | 
			
		||||
        naming_tokens = self.tokens
 | 
			
		||||
        naming_scheme = self.naming_scheme
 | 
			
		||||
        name = naming_scheme.format(**naming_tokens)
 | 
			
		||||
        name += '-' + self.spec.dag_hash(
 | 
			
		||||
        )  # Always append the hash to make the module file unique
 | 
			
		||||
        # Not everybody is working on linux...
 | 
			
		||||
        parts = name.split('/')
 | 
			
		||||
        name = join_path(*parts)
 | 
			
		||||
        # Add optional suffixes based on constraints
 | 
			
		||||
        configuration, _ = parse_config_options(self)
 | 
			
		||||
        suffixes = [name]
 | 
			
		||||
        for constraint, suffix in configuration.get('suffixes', {}).items():
 | 
			
		||||
            if constraint in self.spec:
 | 
			
		||||
                suffixes.append(suffix)
 | 
			
		||||
        # Always append the hash to make the module file unique
 | 
			
		||||
        suffixes.append(self.spec.dag_hash())
 | 
			
		||||
        name = '-'.join(suffixes)
 | 
			
		||||
        return name
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user