Ensure conductor_workers stay at previous value

During the refactoring of the conductor_workers parameter from nova::api
to nova::conductor, the conductor_workers default changed from
$::processorcount to the parameter being absent.

While this is consistent with the nova default behaviour, it changes the
value for people who currently have a different default set. The solution is
to do nothing, in case no value is given.

For reference see:
https://review.openstack.org/#/c/106656
https://review.openstack.org/#/c/108941
http://docs.openstack.org/trunk/config-reference/content/list-of-compute-config-options.html

Change-Id: I908fc4953522f0b1db8f43882a44407aba9fa9f9
This commit is contained in:
David Gurtner
2014-07-25 16:38:37 +02:00
committed by David Gurtner
parent bafaa07028
commit a9201533fd
2 changed files with 7 additions and 11 deletions

View File

@@ -18,7 +18,7 @@
#
# [*workers*]
# (optional) Number of workers for OpenStack Conductor service
# Defaults to undef
# Defaults to undef (i.e. parameter will not be present)
#
class nova::conductor(
$enabled = false,
@@ -36,14 +36,10 @@ class nova::conductor(
service_name => $::nova::params::conductor_service_name,
ensure_package => $ensure_package,
}
if $workers {
nova_config {
'conductor/workers': value => $workers;
}
}
else {
nova_config {
'conductor/workers': ensure => absent;
'conductor/workers': value => $workers;
}
}
}

View File

@@ -16,11 +16,11 @@ describe 'nova::conductor' do
:package_name => 'nova-conductor',
:service_name => 'nova-conductor' }
it { should contain_nova_config('conductor/workers').with_ensure('absent') }
it { should_not contain_nova_config('conductor/workers') }
describe 'when overriding params' do
let :params do
{:workers => '5' }
{:workers => '5' }
end
it { should contain_nova_config('conductor/workers').with_value('5') }
end
@@ -35,11 +35,11 @@ describe 'nova::conductor' do
:name => 'nova-conductor',
:package_name => 'openstack-nova-conductor',
:service_name => 'openstack-nova-conductor' }
it { should contain_nova_config('conductor/workers').with_ensure('absent') }
it { should_not contain_nova_config('conductor/workers') }
describe 'when overriding params' do
let :params do
{:workers => '5' }
{:workers => '5' }
end
it { should contain_nova_config('conductor/workers').with_value('5') }
end