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
the upgrade process mangle weewx.conf #217
Comments
How do we square this with issue #18? |
the only truly bad behavior is adding sections that were not there before, for example StandardReport, FTP, Rsync on an installation that has only custom reports. inserting those stanzas results in unexpected, sometimes broken behavior. "do no harm by inserting stanzas" should apply to every stanza. for example, if a user does not have a StdTimeSync stanza, the update process should not insert one. the only exception would be if a stanza is required for new, required functionality (e.g., DatabaseTypes) the re-insertion of comments and re-arranging of stanzas does not affect functionality, so that should be ok (i find it irritating because i remove all the comments from my production configs, and i use a specific order that is different from the weewx default, but i'm a corner case). |
OK, although I'm a bit fuzzy about what constitutes a "new" stanza. At one point, |
The way it works now, any section that is missing in the user's We could get rid of this behavior, but there are a few "new" sections that truly need to be injected. This includes
They didn't exist before, so we depend on this merge process to include them. So, it seems like the simplest solution is to regard these as "special" sections and inject them. If a section is not on this list, it does not get injected. That means, of course, that the "special" list has to be maintained, but that doesn't seem like too big a burden. Sound good? |
OK, I think I've fixed this as of commit 27bda02 The strategy is to no longer do a merge. Instead, each upgrade adds or changes whatever it needs in This means there is now a lot of logic in the upgrade code, but I think I've captured everything. It needs to be tested thoroughly! |
Yes, and I suspect its not fixed yet. Just went to install latest on a clean Stretch VM and received the following (included the whole thing from ./setup.py onwards, trace at the bottom). Wondered what was going on at first, I run a bash script to install from master and thought this sounded like your install work but that is in development. Checked my script and it turned out I had set it to install development and forgot to change it back. At least that makes a bit more sense.
|
Oops. Try it now. |
development installs fine now. |
doing a setup.py or deb or rpm upgrade inserts sections and comments into the weewx.conf file.
the upgrade process should make an old conf file compatible with the new release, but it should not reorganize the config file, add comments to the config where there were none before, or add sections other than those necessary for compatibility.
examples of bad behavior:
The text was updated successfully, but these errors were encountered: