The current implementation interprets set_default('foo', None) and
set_override('foo', None) as 'clear the existing default or override',
which makes it impossible to override a value with None.
This patch adds support for overriding with a None value by adding
a special internal class. set_override('foo', None) will now override
the existing value with None. This is a slight change to the existing
behavior, so this patch adds two calls for the old functionality of
clearing defaults and overrides. Example syntax for the new calls
are shown below:
Reviewed: https:/ /review. openstack. org/11185 github. com/openstack/ openstack- common/ commit/ 513bd3a91720709 9125cc044705aee 438fee7143
Committed: http://
Submitter: Jenkins
Branch: master
commit 513bd3a91720709 9125cc044705aee 438fee7143
Author: Vishvananda Ishaya <email address hidden>
Date: Fri Aug 10 14:28:59 2012 -0700
Allow set_default and set_override to use None
The current implementation interprets set_default('foo', None) and override( 'foo', None) as 'clear the existing default or override',
set_
which makes it impossible to override a value with None.
This patch adds support for overriding with a None value by adding
a special internal class. set_override('foo', None) will now override
the existing value with None. This is a slight change to the existing
behavior, so this patch adds two calls for the old functionality of
clearing defaults and overrides. Example syntax for the new calls
are shown below:
conf. clear_default( 'foo') clear_override( 'foo')
conf.
The patch also updates the tests to reflect the change in functionality
and adds new tests to verify the new functionality.
Fixes bug 1035478
Change-Id: Iee5e20e44da9be f6b86e0483ab0b4 8b625fe503c