#2809 closed defect (fixed)

Should be an error to put in unknown config items

Reported by: meejah Owned by: meejah
Priority: normal Milestone: 1.12.0
Component: code-nodeadmin Version: 1.11.0
Keywords: Cc:
Launchpad Bug:

Description

Ideally the entire config would be sanity-checked for providing unknown names; at least unknown section-headers should cause an error.

e.g. put [foo] in tahoe.cfg and it will happily start up

Change History (5)

comment:1 Changed at 2016-08-26T17:41:17Z by warner

  • Component changed from code-frontend to code-nodeadmin
  • Milestone changed from undecided to soon

Oh, great idea! Let's add this to client.py, maybe as Client.validate_config(). We need something to enumerate all sections and all keys (but I think the ConfigParser can do this). We can put a big string in client.py with a list of all SECTION KEY strings that are legal, splitlines on it, turn it into a set, then validate_config() just checks every line and throw a ValueError (with the line number) if it seens something that isn't on the list.

comment:2 Changed at 2016-09-02T17:28:09Z by warner

  • Milestone changed from soon to 1.12.0

I'm provisonally pulling this into 1.12, since I think the new tor/i2p options might be safer to use if there's something to catch typos. I'm worried that it might be too much work for this release, though, so I'm prepared to push it out again if it causes trouble.

comment:4 Changed at 2016-09-06T19:28:41Z by warner

  • Owner set to meejah

comment:5 Changed at 2016-09-07T02:24:23Z by Brian Warner <warner@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 74dc719/trunk:

validate_config: improve tests

closes ticket:2809

Note: See TracTickets for help on using tickets.