Add cinder::scheduler::filter for managing scheduler.filter
This patch is aim to add a new class to manage the default filters param in cinder.scheduler. Change-Id: Ie37c3708f66c89d7052f300457b76d29fffb449f
This commit is contained in:
parent
1d752f201b
commit
20b6863d6a
23
manifests/scheduler/filter.pp
Normal file
23
manifests/scheduler/filter.pp
Normal file
@ -0,0 +1,23 @@
|
||||
# == Class: cinder:scheduler::filter
|
||||
#
|
||||
# This class is aim to configure cinder.scheduler filter
|
||||
#
|
||||
# === Parameters:
|
||||
#
|
||||
# [*scheduler_default_filters*]
|
||||
# A comma separated list of filters to be used by default
|
||||
# Defaults to false
|
||||
|
||||
class cinder::scheduler::filter (
|
||||
$scheduler_default_filters = false,
|
||||
) {
|
||||
|
||||
if ($scheduler_default_filters) {
|
||||
cinder_config { 'DEFAULT/scheduler_default_filters': value => join($scheduler_default_filters,',')
|
||||
}
|
||||
} else {
|
||||
cinder_config { 'DEFAULT/scheduler_default_filters': ensure => absent
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -95,6 +95,7 @@ describe 'basic cinder' do
|
||||
class { '::cinder::client': }
|
||||
class { '::cinder::quota': }
|
||||
class { '::cinder::scheduler': }
|
||||
class { '::cinder::scheduler::filter': }
|
||||
class { '::cinder::volume': }
|
||||
# TODO: create a backend and spawn a volume
|
||||
EOS
|
||||
|
17
spec/classes/cinder_scheduler_filter_spec.rb
Normal file
17
spec/classes/cinder_scheduler_filter_spec.rb
Normal file
@ -0,0 +1,17 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'cinder::scheduler::filter' do
|
||||
|
||||
describe 'when overriding params' do
|
||||
|
||||
let :params do
|
||||
{
|
||||
:scheduler_default_filters => ['AvailabilityZoneFilter', 'CapacityFilter', 'CapabilitiesFilter']
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_cinder_config('DEFAULT/scheduler_default_filters').with_value('AvailabilityZoneFilter,CapacityFilter,CapabilitiesFilter') }
|
||||
|
||||
end
|
||||
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user