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

Default generated config doesn't work #314

Open
turt2live opened this issue Sep 11, 2020 · 2 comments
Open

Default generated config doesn't work #314

turt2live opened this issue Sep 11, 2020 · 2 comments
Labels

Comments

@turt2live
Copy link
Member

The generated config has a [DEFAULT] section with all the config options but it doesn't apply the values to the config - one has to move the values to the right sections on their own.

@erikjohnston
Copy link
Member

Related: #287

@cvwright
Copy link

I am just getting started using Sydent, but I think this one might be straightforward?

The comment looks to be correct, but the code gets it backwards. This is sydent.py

    # if the config file doesn't exist, prepopulate the config object
    # with the defaults, in the right section.
    #
    # otherwise, we have to put the defaults in the DEFAULT section,
    # to ensure that they don't override anyone's settings which are
    # in their config file in the default section (which is likely,
    # because sydent used to be braindead).
    use_defaults = not os.path.exists(config_file)

Dropping the not in that last line makes it work for me.

    use_defaults = os.path.exists(config_file)

Without an existing config file, it populates one that looks reasonable. Then after I add my configuration, it doesn't get overwritten on the next run.

But my config is admittedly very simple, and it's possible that I'm missing something more subtle.

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

No branches or pull requests

3 participants