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

Doug Hellmann doug.hellmann at dreamhost.com
Wed Jun 18 15:13:14 UTC 2014


Thanks for the background. I think it has come up a couple of times
recently, so if we're converging on a solution that's good.

Doug

On Wed, Jun 18, 2014 at 10:52 AM, Davanum Srinivas <davanum at gmail.com> wrote:
> Doug,
>
> For the record, yes this came up before in
> https://review.openstack.org/#/c/59994. Gary and I talked about
> $imagecache.image_cache_subdirectory_name when discussing about that
> review.
>
> -- dims
>
> On Wed, Jun 18, 2014 at 10:34 AM, Gary Kotton <gkotton at vmware.com> wrote:
>>
>>
>> On 6/18/14, 4:19 PM, "Doug Hellmann" <doug.hellmann at dreamhost.com> wrote:
>>
>>>On Wed, Jun 18, 2014 at 4:47 AM, Gary Kotton <gkotton at vmware.com> wrote:
>>>> 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://urldefense.proofpoint.com/v1/url?u=https:///&k=oIvRg1%2BdGAgOoM1B
>>>>IlLLqw%3D%3D%0A&r=eH0pxTUZo8NPZyF6hgoMQu%2BfDtysg45MkPhCZFxPEq8%3D%0A&m=t
>>>>PCYaurIa1F3hEMCd5LOOfvP785BZFa8M58fXpp0Lcw%3D%0A&s=2ac62a772fd5bd58fa7cf7
>>>>0a973956ba97f933d649fb2f95be7b7d3e18d2b086 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://urldefense.proofpoint.com/v1/url?u=https:///&k=oIvRg1%2BdGAgOoM1B
>>>>IlLLqw%3D%3D%0A&r=eH0pxTUZo8NPZyF6hgoMQu%2BfDtysg45MkPhCZFxPEq8%3D%0A&m=t
>>>>PCYaurIa1F3hEMCd5LOOfvP785BZFa8M58fXpp0Lcw%3D%0A&s=2ac62a772fd5bd58fa7cf7
>>>>0a973956ba97f933d649fb2f95be7b7d3e18d2b086 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
>>>
>>>Do we need to set the variable off somehow to allow substitutions that
>>>need the literal '.' after a variable? How often is that likely to
>>>come up?
>>
>>
>> To be honest I think that this is a real edge case. I had a chat with
>> markmc on IRC and he suggested a different approach, which I liked,
>> regarding the specific patch. That is, to set the default to None and when
>> the data is accessed to check if it is is None. If so then provide the
>> default values.
>>
>> We may still nonetheless need something like this in the future.
>>
>>>
>>>Doug
>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> OpenStack-dev mailing list
>>>> OpenStack-dev at lists.openstack.org
>>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>>>>
>>>
>>>_______________________________________________
>>>OpenStack-dev mailing list
>>>OpenStack-dev at lists.openstack.org
>>>http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>>
>>
>> _______________________________________________
>> OpenStack-dev mailing list
>> OpenStack-dev at lists.openstack.org
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
>
> --
> Davanum Srinivas :: http://davanum.wordpress.com
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



More information about the OpenStack-dev mailing list