[openstack-dev] [Nova][Oslo.cfg] Configuration string substitution

Gary Kotton gkotton at vmware.com
Wed Jun 18 08:47:06 UTC 2014


Hi,
I have encountered a problem with string substitution with the nova configuration file. The motivation was to move all of the glance settings to their own section (https://review.openstack.org/#/c/100567/). The glance_api_servers had default setting that uses the current glance_host and the glance port. This is a problem when we move to the 'glance' section.
First and foremost I think that we need to decide on how we should denote the string substitutions for group variables and then we can dive into implementation details. Does anyone have any thoughts on this?

My thinking is that when we use we should use a format of $<group>.<key>. An example is below.

Original code:

    cfg.ListOpt('glance_api_servers',
                default=['$glance_host:$glance_port'],
                help='A list of the glance api servers available to nova. '
                     'Prefix with https:// for ssl-based glance api servers. '
                     '([hostname|ip]:port)'),

Proposed change (in the glance section):
    cfg.ListOpt('api_servers',
                default=['$glance.host:$glance.port'],
                help='A list of the glance api servers available to nova. '
                     'Prefix with https:// for ssl-based glance api servers. '
                     '([hostname|ip]:port)',
                deprecated_group='DEFAULT',
                                          deprecated_name='glance_api_servers'),

This would require some preprocessing on the oslo.cfg side to be able to understand the $glance is the specific group and then host is the requested value int he group.

Thanks
Gary

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140618/ae68a45a/attachment.html>


More information about the OpenStack-dev mailing list