Skip to content

Commit 2ba2124

Browse files
committed
consistently include pointer to docs in easystack parser errors
1 parent 0550fc0 commit 2ba2124

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

easybuild/framework/easystack.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
pass
4242
_log = fancylogger.getLogger('easystack', fname=False)
4343

44+
EASYSTACK_DOC_URL = 'https://docs.easybuild.io/en/latest/Easystack-files.html'
45+
4446

4547
def check_value(value, context):
4648
"""
@@ -137,11 +139,12 @@ def parse(filepath):
137139
if len(keys_found) > 1:
138140
keys_string = ', '.join(keys_found)
139141
msg = "Specifying multiple top level keys (%s) " % keys_string
140-
msg += "in one EasyStack file is currently not supported."
142+
msg += "in one EasyStack file is currently not supported"
143+
msg += ", see %s for documentation." % EASYSTACK_DOC_URL
141144
raise EasyBuildError(msg)
142145
elif len(keys_found) == 0:
143146
msg = "Not a valid EasyStack YAML file: no 'easyconfigs' or 'software' top-level key found"
144-
msg += ", see https://docs.easybuild.io/en/latest/Easystack-files.html for documentation."
147+
msg += ", see %s for documentation." % EASYSTACK_DOC_URL
145148
raise EasyBuildError(msg)
146149
else:
147150
key = keys_found[0]
@@ -188,7 +191,7 @@ def parse_by_easyconfigs(filepath, easyconfigs, easybuild_version=None, robot=Fa
188191
dict_keys = ', '.join(easyconfig.keys())
189192
msg = "Failed to parse easystack file: expected a dictionary with one key (the EasyConfig name), "
190193
msg += "instead found keys: %s" % dict_keys
191-
msg += "; see https://docs.easybuild.io/en/latest/Easystack-files.html for documentation."
194+
msg += ", see %s for documentation." % EASYSTACK_DOC_URL
192195
raise EasyBuildError(msg)
193196

194197
return easystack

0 commit comments

Comments
 (0)