[openstack-dev] [openstack][nova] Streamlining of config options in nova
Sean Dague
sean at dague.net
Thu Jul 23 18:50:00 UTC 2015
On 07/23/2015 01:04 PM, Kevin L. Mitchell wrote:
> On Thu, 2015-07-23 at 11:41 -0500, Sean Dague wrote:
>> On 07/23/2015 11:23 AM, Roman Podoliaka wrote:
>>> Hi all,
>>>
>>> FWIW, this is exactly what we have in oslo libs, e.g. in oslo.db [0]
>>>
>>> Putting all Nova options into one big file is probably not a good
>>> idea, still we could consider storing those per-package (per backend,
>>> per driver, etc), rather than per Python module to reduce the number
>>> of possible circular imports when using import_opt() helper.
>>>
>>> Thanks,
>>> Roman
>>>
>>> [0] https://github.com/openstack/oslo.db/blob/master/oslo_db/options.py
>>
>> Actually, we just happened to be discussing this at the Nova meetup this
>> morning. And the general consensus was the opposite. It would be better
>> to collect all the config options in one file, especially if we are
>> going to expand the help (which we would like to do). Exceptions are
>> done that way in Nova.
>>
>> Michael Still is going to propose some initial patches to get this
>> rolling. We don't expect this to be a big bang, but in chunks as the
>> help is being improved.
>
> I'm concerned because of how big the single configuration file will
> become. It is a true pain in the butt to review anything that touches
> the db API (or tests) because of how huge that one file is (traditional
> view in Gerrit performs like a dog on large files), and I'm worried that
> the same will become true of a single nova/flags.py if we go that route.
> I do like Roman's idea of centralizing them into a smattering of files,
> though. What if we were to create a new top-level package and split the
> config options up into a small number of individual files there? Would
> that be a reasonable compromise between Roman's suggestion and the
> one-file-of-config route?
That's a possibility. We have number of files above 4KLOC
4168 nova/tests/unit/virt/xenapi/test_xenapi.py
4203 nova/compute/api.py
6288 nova/compute/manager.py
6397 nova/db/sqlalchemy/api.py
6818 nova/virt/libvirt/driver.py
8609 nova/tests/unit/db/test_db_api.py
11558 nova/tests/unit/compute/test_compute.py
13822 nova/tests/unit/virt/libvirt/test_driver.py
Maybe a directory is fine, especially if module mapped to [subsection].
nova/config/
default.py
glance.py
...
which makes it reasonably discoverable and mappable back and forth from
config file to files.
-Sean
--
Sean Dague
http://dague.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 465 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150723/4ddfd1f9/attachment.pgp>
More information about the OpenStack-dev
mailing list