Accept a string for [DEFAULT] enabled_<type>_interfaces
... as we generally do for list options. Change-Id: I5f14773ddfe928d7566343520d85ab3d8bd62b0e
This commit is contained in:
parent
c8ca1b61ad
commit
447c836c60
@ -37,15 +37,8 @@ define ironic::drivers::hardware_interface (
|
||||
|
||||
include ironic::deps
|
||||
|
||||
if !is_service_default($enabled_list) and !empty($enabled_list){
|
||||
validate_legacy(Array, 'validate_array', $enabled_list)
|
||||
$enabled_list_real = join($enabled_list, ',')
|
||||
} else {
|
||||
$enabled_list_real = $facts['os_service_default']
|
||||
}
|
||||
|
||||
ironic_config {
|
||||
"DEFAULT/enabled_${interface_type}_interfaces": value => $enabled_list_real;
|
||||
"DEFAULT/enabled_${interface_type}_interfaces": value => join(any2array($enabled_list), ',');
|
||||
"DEFAULT/default_${interface_type}_interface": value => $default;
|
||||
}
|
||||
}
|
||||
|
@ -24,10 +24,6 @@ describe 'ironic::drivers::hardware_interface' do
|
||||
let (:title) { 'foo' }
|
||||
|
||||
shared_examples_for 'ironic hardware interface' do
|
||||
let :p do
|
||||
params
|
||||
end
|
||||
|
||||
it 'configures ironic.conf' do
|
||||
is_expected.to contain_ironic_config('DEFAULT/enabled_foo_interfaces').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_ironic_config('DEFAULT/default_foo_interface').with_value('<SERVICE DEFAULT>')
|
||||
@ -36,17 +32,16 @@ describe 'ironic::drivers::hardware_interface' do
|
||||
context 'when overriding parameters' do
|
||||
before :each do
|
||||
params.merge!(
|
||||
:enabled_list => ['one', 'two'],
|
||||
:default => 'two',
|
||||
:enabled_list => ['one', 'two'],
|
||||
:default => 'two',
|
||||
)
|
||||
end
|
||||
|
||||
it 'should replace default parameter with new value' do
|
||||
is_expected.to contain_ironic_config('DEFAULT/enabled_foo_interfaces').with_value('one,two')
|
||||
is_expected.to contain_ironic_config('DEFAULT/default_foo_interface').with_value(p[:default])
|
||||
is_expected.to contain_ironic_config('DEFAULT/default_foo_interface').with_value('two')
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
|
Loading…
Reference in New Issue
Block a user