summaryrefslogtreecommitdiffstats
path: root/openstack/common/context.py
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2012-01-10 20:51:49 +0000
committerMark McLoughlin <markmc@redhat.com>2012-01-10 21:17:14 +0000
commite2c0d86b1c461dbfd0258ed1715e7f2faaf9f119 (patch)
treefa78f0e3bfdb45f728c2287cb2eaeb21b6cd90ac /openstack/common/context.py
parent2e1dda4b75659117dc09ea86973b3035c8c2bd6f (diff)
downloadoslo-e2c0d86b1c461dbfd0258ed1715e7f2faaf9f119.tar.gz
oslo-e2c0d86b1c461dbfd0258ed1715e7f2faaf9f119.tar.xz
oslo-e2c0d86b1c461dbfd0258ed1715e7f2faaf9f119.zip
Add new cfg module
As described here: http://wiki.openstack.org/CommonConfigModule The module implements an API for defining configuration options and reading values for those options that a user may have set in a config file or on the command line. The module is successfully in use in both Nova and Glance. Some work remains in Nova to switch from using it under a gflags compatible shim layer, but Glance is using it fully. There doesn't appear to be any blockers to other projects moving over to it fairly easily. Swift would perhaps be the next project to tackle. Just to go through potential future compatibility concerns: - Nova (the scroundrel) hackily uses the private ConfigOpts::_oparser in order to disable interspersed args. This was just for nova-manage and can probably be resolved some other way. In any case, Nova shouldn't switch to openstack-common's cfg API until it removes this hack. - the CommonConfigOpts subclass set of logging related options is perhaps assuming too much about what configuration options should be common across all the projects. However, it seems a fairly sane set and the worst that can happen is that projects avoid using it. - the parameters to the Opt constructor fairly closely mirror optparse, but they're fairly generic and shouldn't prevent us from switching to e.g. argparse - stuff like %prog expansion in the ConfigOpt's usage ctor param is a similar concern, but it's a very minor concern. - find_config_files() search path is perhaps too much policy for openstack-common; however, it is probably as generic as it could be and projects which need a different policy can just not use the function On the whole, I think we're in good shape wrt future compatibility. Change-Id: I279a9db7806d80aff3b9b085b4a9e4fb193662f9
Diffstat (limited to 'openstack/common/context.py')
0 files changed, 0 insertions, 0 deletions