Comment 2 for bug 1300546

Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

There are a couple of ways to handle this.

The config generator takes as argument the files and directories to scan. Glance could call it multiple times, passing the right set of files each time.

The generator also has a new feature that lets it load entry points that declare sets of options. This was intended for use in libraries, but could be repurposed for having multiple sets of options registered to different apps. See oslo.messaging for an example of the entry points.

Along with this, Mark asked about how to ensure a service only uses the options it declares it is using. The best way to do that is to register the options at runtime, instead of import time. Doing that ensures that a module can't use an option just because it is being imported as a side-effect of importing another module.