From 5970d3dce944f21437756ca49ecd160f6a71e7fb Mon Sep 17 00:00:00 2001 From: Guilherme Schons Date: Fri, 19 May 2023 02:30:49 -0300 Subject: [PATCH] Fix hiera_lookup unescape special characters. Fix the 'puppet lookup' command to unescape special characters. Test Plan: PASS: Use Ruby CLI to test different password possibilites. PASS: Build packages. PASS: Build iso image. PASS: Fresh install Duplex using admin_password starting with special characters. PASS: Fresh install Duplex using admin_passwod not starting special characters PASS: Fresh install Duplex using default admin_password Closes-Bug: 2020148 Change-Id: Ifde68b457a12e808a9878b0cd472c21cea2a1c04 Signed-off-by: Guilherme Schons --- ...okup-function-to-unescape-characters.patch | 28 +++++++++++++++++++ .../debian/patches/series | 1 + ...okup-function-to-unescape-characters.patch | 28 +++++++++++++++++++ .../debian/patches/series | 1 + 4 files changed, 58 insertions(+) create mode 100644 config/puppet-modules/openstack/puppet-keystone-17.4.0/debian/patches/0008-Fix-hiera_lookup-function-to-unescape-characters.patch create mode 100644 config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/patches/0005-Fix-hiera_lookup-function-to-unescape-characters.patch diff --git a/config/puppet-modules/openstack/puppet-keystone-17.4.0/debian/patches/0008-Fix-hiera_lookup-function-to-unescape-characters.patch b/config/puppet-modules/openstack/puppet-keystone-17.4.0/debian/patches/0008-Fix-hiera_lookup-function-to-unescape-characters.patch new file mode 100644 index 000000000..26dc0727e --- /dev/null +++ b/config/puppet-modules/openstack/puppet-keystone-17.4.0/debian/patches/0008-Fix-hiera_lookup-function-to-unescape-characters.patch @@ -0,0 +1,28 @@ +From 0071ccbc87326971769e207af6b6a592571e3bf1 Mon Sep 17 00:00:00 2001 +From: Guilherme Schons +Date: Fri, 19 May 2023 02:22:26 -0300 +Subject: [PATCH] Fix hiera_lookup function to unescape characters + +Fix the 'puppet lookup' command to unescape special characters. + +Signed-off-by: Guilherme Schons +--- + lib/puppet/provider/keystone.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/puppet/provider/keystone.rb b/lib/puppet/provider/keystone.rb +index 2544942..2dd9ce9 100644 +--- a/lib/puppet/provider/keystone.rb ++++ b/lib/puppet/provider/keystone.rb +@@ -227,7 +227,7 @@ class Puppet::Provider::Keystone < Puppet::Provider::Openstack + ### STX Modifications (Start) ### + + def self.hiera_lookup(key) +- %x(sudo puppet lookup #{key})[4...-1] ++ %x(sudo puppet lookup #{key} | sed 's,\",,g')[4...-1] + end + + def self.initial_config_primary? +-- +2.25.1 + diff --git a/config/puppet-modules/openstack/puppet-keystone-17.4.0/debian/patches/series b/config/puppet-modules/openstack/puppet-keystone-17.4.0/debian/patches/series index ef133114e..239a5191e 100644 --- a/config/puppet-modules/openstack/puppet-keystone-17.4.0/debian/patches/series +++ b/config/puppet-modules/openstack/puppet-keystone-17.4.0/debian/patches/series @@ -5,3 +5,4 @@ 0005-Replace-deprecated-idle_timeout-parameter.patch 0006-fix-paths-for-openstack-libs.patch 0007-Replace-deprecated-hiera-function.patch +0008-Fix-hiera_lookup-function-to-unescape-characters.patch diff --git a/config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/patches/0005-Fix-hiera_lookup-function-to-unescape-characters.patch b/config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/patches/0005-Fix-hiera_lookup-function-to-unescape-characters.patch new file mode 100644 index 000000000..f58d678ed --- /dev/null +++ b/config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/patches/0005-Fix-hiera_lookup-function-to-unescape-characters.patch @@ -0,0 +1,28 @@ +From c9317e396969dbadce6d2161c0135defaff1815f Mon Sep 17 00:00:00 2001 +From: Guilherme Schons +Date: Fri, 19 May 2023 11:21:21 -0300 +Subject: [PATCH] Fix hiera_lookup function to unescape characters + +Unescape special characters from the 'puppet lookup' command return. + +Signed-off-by: Guilherme Schons +--- + lib/puppet/provider/openstack/auth.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/puppet/provider/openstack/auth.rb b/lib/puppet/provider/openstack/auth.rb +index 99a8733..e388805 100644 +--- a/lib/puppet/provider/openstack/auth.rb ++++ b/lib/puppet/provider/openstack/auth.rb +@@ -6,7 +6,7 @@ module Puppet::Provider::Openstack::Auth + RCFILENAME = "/etc/platform/openrc" + + def lookup_hiera(key) +- %(sudo puppet lookup #{key})[4...-1] ++ %(sudo puppet lookup #{key} | sed 's,\",,g')[4...-1] + end + + def get_admin_password +-- +2.25.1 + diff --git a/config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/patches/series b/config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/patches/series index 0975d8d7e..804f96fd1 100644 --- a/config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/patches/series +++ b/config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/patches/series @@ -2,3 +2,4 @@ 0002-Replace-deprecated-hiera-function.patch 0003-Adjust-puppetlabs-postgresql-version-requirement.patch 0004-Increase-timeout-from-40s-to-100s.patch +0005-Fix-hiera_lookup-function-to-unescape-characters.patch