X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=meta-stx%2Frecipes-support%2Fpuppet%2Ffiles%2Fpuppet-oslo%2F0002-add-psycopg2-drivername-to-postgresql-settings.patch;fp=meta-stx%2Frecipes-support%2Fpuppet%2Ffiles%2Fpuppet-oslo%2F0002-add-psycopg2-drivername-to-postgresql-settings.patch;h=0000000000000000000000000000000000000000;hb=e0634c6eaf2fe2641a0fb90e84a5defb880b1335;hp=7340a067bb2981cadfc432ef02ab6c1b80ac507d;hpb=210d0f78485e760dffcdd3f630f59cec797f3f11;p=pti%2Frtp.git diff --git a/meta-stx/recipes-support/puppet/files/puppet-oslo/0002-add-psycopg2-drivername-to-postgresql-settings.patch b/meta-stx/recipes-support/puppet/files/puppet-oslo/0002-add-psycopg2-drivername-to-postgresql-settings.patch deleted file mode 100644 index 7340a06..0000000 --- a/meta-stx/recipes-support/puppet/files/puppet-oslo/0002-add-psycopg2-drivername-to-postgresql-settings.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 1823423c329675a72ea5b3497c31f8c407dcdf27 Mon Sep 17 00:00:00 2001 -From: Al Bailey -Date: Thu, 14 Dec 2017 11:08:30 -0600 -Subject: [PATCH] add psycopg2 drivername to postgresql settings - ---- - manifests/db.pp | 13 ++++++++----- - 1 file changed, 8 insertions(+), 5 deletions(-) - -diff --git a/manifests/db.pp b/manifests/db.pp -index 172c8ae..4b918bc 100644 ---- a/manifests/db.pp -+++ b/manifests/db.pp -@@ -132,10 +132,13 @@ define oslo::db( - - if !is_service_default($connection) { - -- validate_re($connection, -- '^(sqlite|mysql(\+pymysql)?|postgresql|mongodb):\/\/(\S+:\S+@\S+\/\S+)?') -+ if $connection !~ '^(sqlite|mysql(\+pymysql)?|postgresql(\+psycopg2)?|mongodb):\/\/(\S+:\S+@\S+\/\S+)?' { -+ err{'invalid database connection parameter: $connection':} -+ } -+ # add psycopg2 drivername to postgresql if using driverless postgres setting -+ $real_connection = regsubst($connection,'^postgresql:','postgresql+psycopg2:') - -- case $connection { -+ case $real_connection { - /^mysql(\+pymysql)?:\/\//: { - require '::mysql::bindings' - require '::mysql::bindings::python' -@@ -145,7 +148,7 @@ define oslo::db( - $backend_package = false - } - } -- /^postgresql:\/\//: { -+ /^postgresql(\+psycopg2)?:\/\//: { - $backend_package = false - require '::postgresql::lib::python' - } -@@ -178,7 +181,7 @@ to connect to the database.") - $database_options = { - 'database/sqlite_synchronous' => { value => $sqlite_synchronous }, - 'database/backend' => { value => $backend }, -- 'database/connection' => { value => $connection, secret => true }, -+ 'database/connection' => { value => $real_connection, secret => true }, - 'database/slave_connection' => { value => $slave_connection, secret => true }, - 'database/mysql_sql_mode' => { value => $mysql_sql_mode }, - 'database/idle_timeout' => { value => $idle_timeout }, --- -1.8.3.1 -