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

[Discussion] Input file formats for the config generator #123

Open
jvillafanez opened this issue Jul 16, 2015 · 1 comment
Open

[Discussion] Input file formats for the config generator #123

jvillafanez opened this issue Jul 16, 2015 · 1 comment

Comments

@jvillafanez
Copy link
Member

Working tree for the config generator: https://github.com/owncloud/smashbox/tree/config_generator

The files are:

  • smashbox.conf.template
  • key-value-file.json.sample

The reason to change the format of the smashbox.conf.template is because the generator needs more information about the variables. The more important information is if the variable needs to be changed, and other information might be a help text, optional type conversion, etc.

In addition If I need to compile and exec the file to load the information.... I don't think it's a good idea.

I had to create a new config key (_configgen) to manage the configuration of the generator. It's currently bloated, from my point of view, because of the lack of information of the keys, so all the information missing has been added there.

The other file is the key-value-file.json.sample. It's json format which seems misplaced in the code, but it has advantages over a plain key=value file.

From my point of view, we have a couple of possibilities:

The first one, use a proper python file that can be easily imported as any other module, something like config_base.py

Config = {
    "key1" : {"value": "value1", "need_to_change":True, "help_text":"an optional help text"},
    "key2" : {"value": "value2"},
    "key3" : {"value":22, "type": "int", "need_to_change":True}
}

ConfigGen = [{
    "KeyRemoverProcessor" : {
        'keylist': ('_configgen', 'oc_server', 'oc_ssl_enabled',
                                    'oc_admin_user')
    }
    .......
}]

The second option is to use a json or yaml format to hold the same information as shown above. Probably json isn't a good choice since it doesn't support comments

Regardless of the format the advantage is an extensible content (new keys as well as more data regarding the keys can be easily added without any disturbance).

Anyway, the output file (the smashbox.conf) will remain the same, at least in the short term

@nickvergessen @PVince81

@nickvergessen
Copy link

etc/smashbox.conf.template is a cernbox file. If we change it, it must be changed in the cern repo.

So feel free to start the discussion at https://github.com/cernbox/smashbox/issues or make your thing so it compiles smashbox.conf.yaml to smashbox.conf

But anyhow we should not "wildly" add new values to that file

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

No branches or pull requests

2 participants