Comment 8 for bug 1278589

Revision history for this message
Barry Warsaw (barry) wrote :

Ah stgraber, right. I was thinking about a use case where a flashed device got switched to an http-only server. Ignoring that, if you flash directly against an alternative server, it would be that service's responsibility to lay down a proper channel.ini file.

Here's an implementation plan then:

* Instead of some magical numeric port number, let's use the string "disabled" (and "disable" as an acceptable but undocumented alternative, hello Postel's law). No quotes.

* You'll need to change the conversion function in config.py to accept either a numeric port number or disabled/disable. In the latter case, set http_port to a special marker object defined and exported in config.py

* Extra credit: explicitly disallow the port from being negative (raise an exception). For now, we'll still accept zero.

* Where we calculate http_base and https_base, check against the marker object and collapse the value of the disabled protocol to the enabled protocol, as discussed above. Extra credit: explicitly disallow setting both to disabled (raise an exception).

* Change Configuration.load() to allow overriding of the [service] section in channel.ini.

* Update ini-manpage.rst

* Add tests. You'll need tests in test_config.py for all the various corner cases, and probably one end-to-end test in test_state.py and/or test_dbus.py

I think that should do it, and it's not that much code. Most of the changes will be in config.py, other than the tests, and I predict test delta will outnumber non-test delta. :)