Skip to content

perform early 'raw' parse of provided easyconfig file to check for syntax error or faulty inputs#2523

Merged
migueldiascosta merged 2 commits intoeasybuilders:developfrom
boegel:pre_parse_check_easyconfig_contents
Jun 29, 2018
Merged

perform early 'raw' parse of provided easyconfig file to check for syntax error or faulty inputs#2523
migueldiascosta merged 2 commits intoeasybuilders:developfrom
boegel:pre_parse_check_easyconfig_contents

Conversation

@boegel
Copy link
Copy Markdown
Member

@boegel boegel commented Jun 28, 2018

As raised in #2383, we currently do a poor job of verifying whether the specified files actually really are easyconfig files before we start processing them...

The fix for this is pretty straightforward: initialize the EasyConfigParser object a bit earlier, since that also includes a "raw" parse of the easyconfig file (basically just interpreting the Python code in it).

This leads to a clear error when something other than an easyconfig file is passed by accident, for example an HTML page obtained by incorrectly downloading an easyconfig file using wget:

$ eb test/framework/sandbox/not_an_easyconfig.eb
== temporary log file in case of crash /tmp/eb-P6752K/easybuild-h_JEyc.log
ERROR: Failed to process easyconfig /Volumes/work/easybuild-framework/test/framework/sandbox/not_an_easyconfig.eb: Parsing easyconfig file failed: invalid syntax (<string>, line 1)

@boegel boegel added this to the 3.6.2 milestone Jun 28, 2018
@boegel boegel changed the title Pre parse check easyconfig contents perform early 'raw' parse of provided easyconfig file to check for syntax error or faulty inputs Jun 28, 2018
@boegel boegel requested a review from migueldiascosta June 28, 2018 09:42
Copy link
Copy Markdown
Member

@migueldiascosta migueldiascosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm (and the test passes)

@migueldiascosta migueldiascosta merged commit 3aef0de into easybuilders:develop Jun 29, 2018
@boegel boegel deleted the pre_parse_check_easyconfig_contents branch August 18, 2020 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants