Skip to content

Commit

Permalink
Fix package ceilometer-alarm type error on Debian
Browse files Browse the repository at this point in the history
This commit:
  - Fix type error about ceilometer-alarm package name
    - See bug #1263946
  - Fix indentation on Debian params.pp
  - Fix spec warnings (partition_rpc_topic,record_history)

Closes-bug: #1263946

Change-Id: I1ad19af429f2787d58837e51da95e981bdd66b40
  • Loading branch information
sbadia committed Jan 4, 2014
1 parent b3e43a4 commit 5bc3311
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 43 deletions.
11 changes: 3 additions & 8 deletions manifests/alarm/evaluator.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,9 @@

Ceilometer_config<||> ~> Service['ceilometer-alarm-evaluator']

Package['ceilometer-alarm'] -> Service['ceilometer-alarm-evaluator']

if !defined(Package['ceilometer-alarm']){
package { 'ceilometer-alarm':
ensure => installed,
name => $::ceilometer::params::alarm_package_name,
}
}
Package[$::ceilometer::params::alarm_package_name] -> Service['ceilometer-alarm-evaluator']
Package[$::ceilometer::params::alarm_package_name] -> Package<| title == 'ceilometer-alarm' |>
ensure_packages($::ceilometer::params::alarm_package_name)

if $enabled {
$service_ensure = 'running'
Expand Down
11 changes: 3 additions & 8 deletions manifests/alarm/notifier.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,9 @@

Ceilometer_config<||> ~> Service['ceilometer-alarm-notifier']

Package['ceilometer-alarm'] -> Service['ceilometer-alarm-notifier']

if !defined(Package['ceilometer-alarm']){
package { 'ceilometer-alarm':
ensure => installed,
name => $::ceilometer::params::alarm_package_name,
}
}
Package[$::ceilometer::params::alarm_package_name] -> Service['ceilometer-alarm-notifier']
Package[$::ceilometer::params::alarm_package_name] -> Package<| title == 'ceilometer-alarm' |>
ensure_packages($::ceilometer::params::alarm_package_name)

if $enabled {
$service_ensure = 'running'
Expand Down
22 changes: 11 additions & 11 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
$agent_compute_package_name = 'openstack-ceilometer-compute'
$api_package_name = 'openstack-ceilometer-api'
$collector_package_name = 'openstack-ceilometer-collector'
$alarm_package_name = 'openstack-ceilometer-alarm'
$alarm_package_name = ['openstack-ceilometer-alarm']
$common_package_name = 'openstack-ceilometer-common'
$client_package_name = 'python-ceilometerclient'
# service names
Expand All @@ -36,13 +36,13 @@
}
'Debian': {
# package names
$agent_central_package_name = 'ceilometer-agent-central'
$agent_compute_package_name = 'ceilometer-agent-compute'
$api_package_name = 'ceilometer-api'
$collector_package_name = 'ceilometer-collector'
$common_package_name = 'ceilometer-common'
$client_package_name = 'python-ceilometerclient'
$alarm_package_name = ['ceilometer-alarm-evaluator', 'ceilometer-alarm-notifier' ]
$agent_central_package_name = 'ceilometer-agent-central'
$agent_compute_package_name = 'ceilometer-agent-compute'
$api_package_name = 'ceilometer-api'
$collector_package_name = 'ceilometer-collector'
$common_package_name = 'ceilometer-common'
$client_package_name = 'python-ceilometerclient'
$alarm_package_name = ['ceilometer-alarm-notifier','ceilometer-alarm-evaluator']
# service names
$agent_central_service_name = 'ceilometer-agent-central'
$agent_compute_service_name = 'ceilometer-agent-compute'
Expand All @@ -51,9 +51,9 @@
$alarm_notifier_service_name = 'ceilometer-alarm-notifier'
$alarm_evaluator_service_name = 'ceilometer-alarm-evaluator'
# db packages
$psycopg_package_name = 'python-psycopg2'
$pymongo_package_name = 'python-pymongo'
$sqlite_package_name = 'python-pysqlite2'
$psycopg_package_name = 'python-psycopg2'
$pymongo_package_name = 'python-pymongo'
$sqlite_package_name = 'python-pysqlite2'

# Operating system specific
case $::operatingsystem {
Expand Down
17 changes: 8 additions & 9 deletions spec/classes/ceilometer_alarm_evaluator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
it { should contain_class('ceilometer::params') }

it 'installs ceilometer-alarm package' do
should contain_package('ceilometer-alarm').with(
:ensure => 'installed',
:name => platform_params[:alarm_package_name],
:before => 'Service[ceilometer-alarm-evaluator]'
should contain_package(platform_params[:alarm_evaluator_package_name]).with_before('Service[ceilometer-alarm-evaluator]')
should contain_package(platform_params[:alarm_evaluator_package_name]).with(
:ensure => 'present',
:name => platform_params[:alarm_evaluator_package_name]
)
end

Expand All @@ -46,8 +46,8 @@
it 'configures alarm evaluator' do
should contain_ceilometer_config('alarm/evaluation_interval').with_value( params[:evaluation_interval] )
should contain_ceilometer_config('alarm/evaluation_service').with_value( params[:evaluation_service] )
should contain_ceilometer_config('alarm/partition_rpc_topic').with_value (params[:partition_rpc_topic] )
should contain_ceilometer_config('alarm/record_history').with_value (params[:record_history] )
should contain_ceilometer_config('alarm/partition_rpc_topic').with_value( params[:partition_rpc_topic] )
should contain_ceilometer_config('alarm/record_history').with_value( params[:record_history] )
end

context 'when overriding parameters' do
Expand Down Expand Up @@ -79,8 +79,7 @@
end

let :platform_params do
{ :alarm_package_name => ['ceilometer-alarm-evaluator',
'ceilometer-alarm-notifier' ],
{ :alarm_evaluator_package_name => 'ceilometer-alarm-evaluator',
:alarm_evaluator_service_name => 'ceilometer-alarm-evaluator' }
end

Expand All @@ -93,7 +92,7 @@
end

let :platform_params do
{ :alarm_package_name => 'openstack-ceilometer-alarm',
{ :alarm_evaluator_package_name => 'openstack-ceilometer-alarm',
:alarm_evaluator_service_name => 'openstack-ceilometer-alarm-evaluator' }
end

Expand Down
13 changes: 6 additions & 7 deletions spec/classes/ceilometer_alarm_notifier_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
it { should contain_class('ceilometer::params') }

it 'installs ceilometer-alarm package' do
should contain_package('ceilometer-alarm').with(
:ensure => 'installed',
:name => platform_params[:alarm_package_name],
:before => 'Service[ceilometer-alarm-notifier]'
should contain_package(platform_params[:alarm_notifier_package_name]).with_before('Service[ceilometer-alarm-notifier]')
should contain_package(platform_params[:alarm_notifier_package_name]).with(
:ensure => 'present',
:name => platform_params[:alarm_notifier_package_name]
)
end

Expand Down Expand Up @@ -72,8 +72,7 @@
end

let :platform_params do
{ :alarm_package_name => ['ceilometer-alarm-evaluator',
'ceilometer-alarm-notifier' ],
{ :alarm_notifier_package_name => 'ceilometer-alarm-notifier',
:alarm_notifier_service_name => 'ceilometer-alarm-notifier' }
end

Expand All @@ -86,7 +85,7 @@
end

let :platform_params do
{ :alarm_package_name => 'openstack-ceilometer-alarm',
{ :alarm_notifier_package_name => 'openstack-ceilometer-alarm',
:alarm_notifier_service_name => 'openstack-ceilometer-alarm-notifier' }
end

Expand Down

0 comments on commit 5bc3311

Please sign in to comment.