Merge "db: Remove MongoDB backend support"

This commit is contained in:
Zuul 2022-05-23 17:41:50 +00:00 committed by Gerrit Code Review
commit 9fdd85639e
4 changed files with 5 additions and 40 deletions

View File

@ -146,7 +146,7 @@ define oslo::db(
if !is_service_default($connection) {
validate_legacy(Oslo::Dbconn, 'validate_re', $connection,
['^(sqlite|mysql(\+pymysql)?|postgresql(\+psycopg2)?|mongodb):\/\/(\S+:\S+@\S+\/\S+)?'])
['^(sqlite|mysql(\+pymysql)?|postgresql(\+psycopg2)?):\/\/(\S+:\S+@\S+\/\S+)?'])
if $manage_backend_package {
case $connection {
@ -163,9 +163,6 @@ define oslo::db(
$backend_package = false
require 'postgresql::lib::python'
}
/^mongodb:\/\//: {
$backend_package = $::oslo::params::pymongo_package_name
}
/^sqlite:\/\//: {
$backend_package = $::oslo::params::sqlite_package_name
}

View File

@ -5,7 +5,6 @@
class oslo::params {
include openstacklib::defaults
$pymongo_package_name = 'python3-pymongo'
$pylibmc_package_name = 'python3-pylibmc'
case $::osfamily {

View File

@ -0,0 +1,4 @@
---
upgrade:
- |
The ``oslo::db`` defined resource type no longer supports MongoDB backend.

View File

@ -78,41 +78,6 @@ describe 'oslo::db' do
end
end
context 'with mongodb backend' do
let :params do
{ :connection => 'mongodb://localhost:1234/db' }
end
it 'install the proper backend package' do
is_expected.to contain_package(platform_params[:pymongo_package_name]).with(
:ensure => 'present',
:name => platform_params[:pymongo_package_name],
:tag => 'openstack'
)
end
context 'with backend package management disabled' do
before do
params.merge!({
:manage_backend_package => false,
})
end
it 'does not install backend package' do
is_expected.not_to contain_package('python-pymongo')
end
end
end
context 'with specific mongodb connection string' do
let :params do
{ :connection => 'mongodb://user:password@host1:27017,host2:27017,host3:27017/db_name?replicaSet=replica&readPreference=primaryPreferred' }
end
it { is_expected.to contain_keystone_config('database/connection').with_value(
'mongodb://user:password@host1:27017,host2:27017,host3:27017/db_name?replicaSet=replica&readPreference=primaryPreferred').with_secret(true) }
end
context 'with pymysql connection' do
let :params do
{ :connection => 'mysql+pymysql://db:db@localhost/db' }