Unpin modulesync

... to use the recent modulesync which is compatible with Ruby 3.0.

This also fixes the failing unit tests, which were broken by recent
change in puppet-postgresql.

Depends-on: https://review.opendev.org/853222
Change-Id: Idca10381dc8204e2c35491b92d0f60b3566d4375
This commit is contained in:
Takashi Kajinami 2022-06-13 10:50:49 +09:00
parent 175ca29fab
commit 191b2ee267
3 changed files with 22 additions and 12 deletions

View File

@ -145,10 +145,18 @@ else
git clone https://opendev.org/x/puppet-modulesync-configs x/puppet-modulesync-configs
fi
pushd x/puppet-modulesync-configs/
#TODO(aschultz): fixme after we unstick the gate
# 0.8.x doesn't seem to work with out configs so we need to pin this but the
# this script is unhappy.
sed -i "s/'>=0.6.0'/['>=0.6.0','<0.8.0']/" Gemfile
# TODO(tkajinam): Remove this once we remove pinning from
# puppet-modulesync-configs
if grep -q "gem 'modulesync', " ./Gemfile ; then
sed -i "s/^gem 'modulesync', .*/gem 'modulesync'/" ./Gemfile
find moduleroot/ -type f -exec git mv {} {}.erb \;
fi
# Purge .git to make sure the git command in the subdirectory does not look up
# the git infomation at the top directory.
rm -rf .git
[ -z "${testing}" ] || ${GEM_HOME}/bin/bundle install
cat > managed_modules.yml <<EOF
---
@ -168,7 +176,8 @@ if [ -z "${testing}" ]; then
else
${GEM_HOME}/bin/bundle exec msync update --noop
fi
pushd modules/puppet-$proj
pushd modules/cookiecutter/puppet-$proj
check_gerrit_user
@ -189,7 +198,7 @@ echo "
-----------------------------------------------------------------------------------------------------
The new project has been successfully set up.
To submit the initial review please go to ${tmp_var}/openstack/puppet-modulesync-configs/modules/puppet-${proj}
To submit the initial review please go to ${tmp_var}/openstack/puppet-modulesync-configs/modules/cookiecutter/puppet-${proj}
and run git review.
Happy Hacking !

View File

@ -16,7 +16,7 @@ EOF
# Build fake module
OS_NEW_MODULE_TEST=yes bash -x ./contrib/bootstrap.sh whazz dummy
cd puppet-whazz/x/puppet-modulesync-configs/modules/puppet-whazz
cd puppet-whazz/x/puppet-modulesync-configs/modules/cookiecutter/puppet-whazz
$GEM_HOME/bin/bundle install
}

View File

@ -33,13 +33,14 @@ describe '{{cookiecutter.project_name}}::db::postgresql' do
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts({ :concat_basedir => '/var/lib/puppet/concat' }))
facts.merge!(OSDefaults.get_facts({
# puppet-postgresql requires the service_provider fact provided by
# puppetlabs-postgresql.
:service_provider => 'systemd'
}))
end
# TODO(tkajinam): Remove this once puppet-postgresql supports CentOS 9
unless facts[:osfamily] == 'RedHat' and facts[:operatingsystemmajrelease].to_i >= 9
it_behaves_like '{{cookiecutter.project_name}}::db::postgresql'
end
it_behaves_like '{{cookiecutter.project_name}}::db::postgresql'
end
end
end