diff --git a/manifests/db.pp b/manifests/db.pp index 67caf98..a59bb8d 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -62,7 +62,7 @@ class murano::db ( require mysql::bindings::python } /^postgresql:\/\//: { - $backend_package = $::murano::params::psycopg_package_name + $backend_package = false require postgresql::lib::python } default: { diff --git a/manifests/params.pp b/manifests/params.pp index 5dea1bc..875157b 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -14,7 +14,6 @@ class murano::params { $engine_package_name = 'openstack-murano-engine' $pythonclient_package_name = 'openstack-python-muranoclient' $dashboard_package_name = 'openstack-murano-dashboard' - $psycopg_package_name = 'python-psycopg2' # service names $api_service_name = 'murano-api' $engine_service_name = 'murano-engine' @@ -28,7 +27,6 @@ class murano::params { $engine_package_name = 'murano-engine' $pythonclient_package_name = 'python-muranoclient' $dashboard_package_name = 'python-murano-dashboard' - $psycopg_package_name = 'python-psycopg2' # service names $api_service_name = 'murano-api' $engine_service_name = 'murano-engine' diff --git a/spec/classes/murano_db_spec.rb b/spec/classes/murano_db_spec.rb index f12f4a6..e8d0c8c 100644 --- a/spec/classes/murano_db_spec.rb +++ b/spec/classes/murano_db_spec.rb @@ -34,6 +34,17 @@ describe 'murano::db' do it { is_expected.to contain_murano_config('database/max_overflow').with_value('21') } end + context 'with postgresql backend' do + let :params do + { :database_connection => 'postgresql://murano:murano@localhost/murano', } + end + + it 'install the proper backend package' do + is_expected.to contain_package('python-psycopg2').with(:ensure => 'present') + end + + end + context 'with incorrect database_connection string' do let :params do { :database_connection => 'sqlite://murano:murano@localhost/murano', } @@ -45,7 +56,10 @@ describe 'murano::db' do context 'on Debian platforms' do let :facts do - { :osfamily => 'Debian' } + { :osfamily => 'Debian', + :operatingsystem => 'Debian', + :operatingsystemrelease => 'jessie', + } end it_configures 'murano::db' @@ -53,10 +67,12 @@ describe 'murano::db' do context 'on Redhat platforms' do let :facts do - { :osfamily => 'RedHat' } + { :osfamily => 'RedHat', + :operatingsystemrelease => '7.1', + } end it_configures 'murano::db' end -end \ No newline at end of file +end