Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eb --confighelp contains wrong options in [job] section #1331

Open
moschlar opened this issue Jul 29, 2015 · 3 comments
Open

eb --confighelp contains wrong options in [job] section #1331

moschlar opened this issue Jul 29, 2015 · 3 comments
Milestone

Comments

@moschlar
Copy link

When I uncomment the option job-backend-config in the [job] section, I only get the following error message:

ERROR: Failed to parse configuration options: parseconfigfiles: no option corresponding with opt job-backend-config dest job_job_backend_config in section job

It seems that the section title automatically gets prepended to the option name, so when I strip the job- prefix from the option name, it works as expected.

@boegel
Copy link
Member

boegel commented Aug 13, 2015

Thanks for the bug report. This looks like a option with the option parser used by EasyBuild.

cc @stdweird this looks like a bug in generaloption?

@boegel
Copy link
Member

boegel commented Oct 28, 2015

requires that hpcugent/vsc-base#211 is fixed

@boegel boegel modified the milestones: v2.5.0, v2.4.0 Oct 28, 2015
@boegel boegel modified the milestones: v2.5.0, v2.6.0 Dec 14, 2015
@boegel boegel modified the milestones: v2.6.0, v2.7.0 Jan 22, 2016
@boegel boegel modified the milestones: v2.7.0, v2.8.0 Mar 9, 2016
@boegel boegel modified the milestones: v2.8.0, v2.9.0 May 10, 2016
@boegel boegel modified the milestones: v2.9.0, v3.0 Sep 16, 2016
@boegel boegel modified the milestones: v3.0, v3.1 Nov 10, 2016
@boegel boegel modified the milestones: 3.1.0, 3.x Jan 14, 2017
@boegel boegel modified the milestones: 3.x, 4.x Feb 20, 2020
@Flamefire
Copy link
Contributor

I dug a bit and found a couple of design issues here. The major one blocking this is the following:

  • EasyBuildOptions (class GeneralOption) contains OptionGroups and a parser
  • The prefix is incorporated into the Option added to the OptionGroup, which the parser uses
  • Parsing the config file(s) is done by GeneralOption with something I'd call a "hack" to provide support for prefixes which then yields full options that are then passed to the cmdline parser
  • The confighelp is implemented at the parser level (in the parser)

So in summary: The parser which does not know anything about config files is responsible for generating the config file.
The parser doesn't even know, how to construct a prefixed option, even less how to decompose one.

--> I'd suggest some reengineering to put the --confighelp into the GeneralOption and maybe also some refactoring how those are handled. There are some places, where dicts would be much more useful, and another where a NamedTuple would be due (see PROCESSED_OPTIONS_PROPERTIES)

And maybe GeneralOption could be renamed too, I found it confusing while checking the code because it is not "1 option" but a container and handler of all options, parsers, config files etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants