modules : it's possible to add suffixes to module files based on constraint
This commit is contained in:
parent
0890ac4507
commit
84707ed926
@ -287,6 +287,7 @@
|
|||||||
'prerequisites': {'$ref': '#/definitions/dependency_selection'},
|
'prerequisites': {'$ref': '#/definitions/dependency_selection'},
|
||||||
'conflict': {'$ref': '#/definitions/array_of_strings'},
|
'conflict': {'$ref': '#/definitions/array_of_strings'},
|
||||||
'load': {'$ref': '#/definitions/array_of_strings'},
|
'load': {'$ref': '#/definitions/array_of_strings'},
|
||||||
|
'suffixes': {'$ref': '#/definitions/dictionary_of_strings'},
|
||||||
'environment': {
|
'environment': {
|
||||||
'type': 'object',
|
'type': 'object',
|
||||||
'default': {},
|
'default': {},
|
||||||
|
@ -285,11 +285,18 @@ def use_name(self):
|
|||||||
naming_tokens = self.tokens
|
naming_tokens = self.tokens
|
||||||
naming_scheme = self.naming_scheme
|
naming_scheme = self.naming_scheme
|
||||||
name = naming_scheme.format(**naming_tokens)
|
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...
|
# Not everybody is working on linux...
|
||||||
parts = name.split('/')
|
parts = name.split('/')
|
||||||
name = join_path(*parts)
|
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
|
return name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
Reference in New Issue
Block a user