diff --git a/manifests/db.pp b/manifests/db.pp index 79a98644..dbe02cd0 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -22,8 +22,8 @@ class ceilometer::db ( $backend_package = false include mysql::python } - /^postgresql:\/\//: { - $backend_package = 'python-psycopg2' + /^postgres:\/\//: { + $backend_package = $::ceilometer::params::psycopg_package_name } /^mongodb:\/\//: { $backend_package = $::ceilometer::params::pymongo_package_name diff --git a/manifests/params.pp b/manifests/params.pp index 7c0f0a6e..d0d00ad5 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -9,28 +9,27 @@ class ceilometer::params { case $::osfamily { 'RedHat': { # package names - $agent_central_package_name = 'openstack-ceilometer-central' - $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' - $common_package_name = 'openstack-ceilometer-common' - $client_package_name = 'python-ceilometerclient' + $agent_central_package_name = 'openstack-ceilometer-central' + $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' + $common_package_name = 'openstack-ceilometer-common' + $client_package_name = 'python-ceilometerclient' # service names - $agent_central_service_name = 'openstack-ceilometer-central' - $agent_compute_service_name = 'openstack-ceilometer-compute' - $api_service_name = 'openstack-ceilometer-api' - $collector_service_name = 'openstack-ceilometer-collector' + $agent_central_service_name = 'openstack-ceilometer-central' + $agent_compute_service_name = 'openstack-ceilometer-compute' + $api_service_name = 'openstack-ceilometer-api' + $collector_service_name = 'openstack-ceilometer-collector' $alarm_notifier_service_name = 'openstack-ceilometer-alarm-notifier' $alarm_evaluator_service_name = 'openstack-ceilometer-alarm-evaluator' + $pymongo_package_name = 'python-pymongo' + $psycopg_package_name = 'python-psycopg2' # db packages if $::operatingsystem == 'Fedora' and $::operatingsystemrelease >= 18 { - # name change in f18 : https://bugzilla.redhat.com/show_bug.cgi?id=954155 - $pymongo_package_name = 'python-pymongo' # fallback to stdlib version, not provided on fedora $sqlite_package_name = undef } else { - $pymongo_package_name = 'pymongo' $sqlite_package_name = 'python-sqlite2' } @@ -52,6 +51,7 @@ class ceilometer::params { $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' diff --git a/spec/classes/ceilometer_db_spec.rb b/spec/classes/ceilometer_db_spec.rb index 7e497a45..0a185ddc 100644 --- a/spec/classes/ceilometer_db_spec.rb +++ b/spec/classes/ceilometer_db_spec.rb @@ -45,7 +45,7 @@ describe 'ceilometer::db' do end end - # RHEL has pymongo + # RHEL has python-pymongo too context 'on Redhat platforms' do let :facts do { :osfamily => 'Redhat', @@ -63,7 +63,7 @@ describe 'ceilometer::db' do it 'installs pymongo package' do should contain_package('ceilometer-backend-package').with( :ensure => 'present', - :name => 'pymongo') + :name => 'python-pymongo') end end