Fix idempotency with empty available filters
If an empty array is passed in for the available filters, the provider
is improperly thinking a configuration value needs to be done. This
change checks for this case and sets it to $::os_service_default.
Change-Id: Iea0d874108b39609505e542eda29b9bb74ca2a35
Closes-Bug: #1665443
Related-Bug: #1664650
(cherry picked from commit 334eec2fd0
)
This commit is contained in:
parent
0633475b65
commit
8978f769a2
|
@ -156,7 +156,11 @@ class nova::scheduler::filter (
|
||||||
}
|
}
|
||||||
|
|
||||||
if is_array($scheduler_available_filters) {
|
if is_array($scheduler_available_filters) {
|
||||||
|
if empty($scheduler_available_filters) {
|
||||||
|
$scheduler_available_filters_real = $::os_service_default
|
||||||
|
} else {
|
||||||
$scheduler_available_filters_real = $scheduler_available_filters
|
$scheduler_available_filters_real = $scheduler_available_filters
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
warning('scheduler_available_filters must be an array and will fail in the future')
|
warning('scheduler_available_filters must be an array and will fail in the future')
|
||||||
$scheduler_available_filters_real = any2array($scheduler_available_filters)
|
$scheduler_available_filters_real = any2array($scheduler_available_filters)
|
||||||
|
|
|
@ -71,12 +71,14 @@ describe 'nova::scheduler::filter' do
|
||||||
let :params do
|
let :params do
|
||||||
{ :isolated_images => [],
|
{ :isolated_images => [],
|
||||||
:isolated_hosts => [],
|
:isolated_hosts => [],
|
||||||
|
:scheduler_available_filters => [],
|
||||||
:scheduler_default_filters => [],
|
:scheduler_default_filters => [],
|
||||||
:baremetal_scheduler_default_filters => [], }
|
:baremetal_scheduler_default_filters => [], }
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_nova_config('filter_scheduler/isolated_images').with_value('<SERVICE DEFAULT>') }
|
it { is_expected.to contain_nova_config('filter_scheduler/isolated_images').with_value('<SERVICE DEFAULT>') }
|
||||||
it { is_expected.to contain_nova_config('filter_scheduler/isolated_hosts').with_value('<SERVICE DEFAULT>') }
|
it { is_expected.to contain_nova_config('filter_scheduler/isolated_hosts').with_value('<SERVICE DEFAULT>') }
|
||||||
|
it { is_expected.to contain_nova_config('filter_scheduler/available_filters').with_value('<SERVICE DEFAULT>') }
|
||||||
it { is_expected.to contain_nova_config('filter_scheduler/enabled_filters').with_value('<SERVICE DEFAULT>') }
|
it { is_expected.to contain_nova_config('filter_scheduler/enabled_filters').with_value('<SERVICE DEFAULT>') }
|
||||||
it { is_expected.to contain_nova_config('filter_scheduler/baremetal_enabled_filters').with_value('<SERVICE DEFAULT>') }
|
it { is_expected.to contain_nova_config('filter_scheduler/baremetal_enabled_filters').with_value('<SERVICE DEFAULT>') }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue