Improve help message for scheduler_available_filters

Config option scheduler_available_filters default value
'all' is not much clear as it doesn't mean that all the
existing filters are enabled. It is just the indication
of the case when all of the available filters
(from DEFAULT.scheduler_available_filters in nova.conf)
are enabled.

Also add clear doc string for is_scheduler_filter_enabled
function which is used to evaluate this option value.

Change-Id: If9a52003309686cc257e62737e52c2cc52ddc659
Closes-Bug: #1628443
This commit is contained in:
ghanshyam 2016-12-01 11:38:46 +09:00 committed by Ghanshyam Mann
parent 742c7ee2ef
commit 5817e14f09
2 changed files with 19 additions and 5 deletions

View File

@ -422,10 +422,16 @@ ComputeFeaturesGroup = [
default=['all'],
help="A list of enabled filters that nova will accept as hints"
" to the scheduler when creating a server. A special "
"entry 'all' indicates all filters are enabled. Empty "
"list indicates all filters are disabled. The full "
"available list of filters is in nova.conf: "
"DEFAULT.scheduler_available_filters"),
"entry 'all' indicates all filters that are included "
"with nova are enabled. Empty list indicates all filters "
"are disabled. The full list of available filters is in "
"nova.conf: DEFAULT.scheduler_available_filters. If the "
"default value is overridden in nova.conf by the test "
"environment (which means that a different set of "
"filters is enabled than what is included in Nova by "
"default) then, this option must be configured to "
"contain the same filters that Nova uses in the test "
"environment."),
cfg.BoolOpt('swap_volume',
default=False,
help='Does the test environment support in-place swapping of '

View File

@ -142,7 +142,15 @@ def is_extension_enabled(extension_name, service):
def is_scheduler_filter_enabled(filter_name):
"""Check the list of enabled compute scheduler filters from config. """
"""Check the list of enabled compute scheduler filters from config.
This function checks whether the given compute scheduler filter is
available and configured in the config file. If the
scheduler_available_filters option is set to 'all' (Default value. which
means default filters are configured in nova) in tempest.conf then, this
function returns True with assumption that requested filter 'filter_name'
is one of available filter in nova ("nova.scheduler.filters.all_filters").
"""
filters = CONF.compute_feature_enabled.scheduler_available_filters
if len(filters) == 0: